diff --git a/Makefile b/Makefile index b7cc87a8e..2e2bc7667 100644 --- a/Makefile +++ b/Makefile @@ -10,9 +10,9 @@ SIMAPP = ./app # for dockerized protobuf tools DOCKER := $(shell which docker) -BUF_IMAGE=bufbuild/buf@sha256:3cb1f8a4b48bd5ad8f09168f10f607ddc318af202f5c057d52a45216793d85e5 #v1.4.0 -DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(BUF_IMAGE) -HTTPS_GIT := https://github.com/jackal-dao/canine.git +BUF_IMAGE=bufbuild/buf #@sha256:3cb1f8a4b48bd5ad8f09168f10f607ddc318af202f5c057d52a45216793d85e5 #v1.4.0 +DOCKER_BUF := $(DOCKER) run --platform="linux/amd64" --rm -v $(CURDIR):/workspace --workdir /workspace $(BUF_IMAGE) +HTTPS_GIT := https://github.com/jackalLabs/canine-chain.git export GO111MODULE = on @@ -59,7 +59,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=canine \ -X github.com/cosmos/cosmos-sdk/version.AppName=canined \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ - -X github.com/jackal-dao/canine/app.Bech32Prefix=jkl \ + -X github.com/jackalLabs/canine-chain/app.Bech32Prefix=jkl \ -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" ifeq ($(WITH_CLEVELDB),yes) @@ -161,7 +161,7 @@ lint: format-tools format: format-tools find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w -s find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/jackal-dao/canine + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/jackalLabs/canine-chain ############################################################################### @@ -173,15 +173,14 @@ PROTO_FORMATTER_IMAGE=tendermintdev/docker-build-proto proto-all: proto-format proto-lint proto-gen format proto-gen: - @echo "Generating Protobuf files" - $(DOCKER) run --platform="linux/amd64" --rm -v $(CURDIR):/workspace --workdir /workspace $(PROTO_BUILDER_IMAGE) sh ./scripts/protocgen.sh + ./scripts/protocgen.sh proto-format: @echo "Formatting Protobuf files" $(DOCKER) run --rm -v $(CURDIR):/workspace \ --workdir /workspace $(PROTO_FORMATTER_IMAGE) \ - find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \; + find ./ -name *.proto -exec clang-format -i {} \; proto-swagger-gen: @./scripts/protoc-swagger-gen.sh diff --git a/README.md b/README.md index 916ade446..995283619 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ To install `canined` on your Linux machine: `go install ./...` ### Pre-built Binary -[Releases](https://github.com/JACKAL-DAO/canine-chain/releases) and download the latest release. Move the executable to a folder in your `$PATH` and download [this](https://github.com/CosmWasm/wasmvm/raw/v1.1.1/internal/api/libwasmvm.x86_64.so) to `/lib/libwasmvm.x86_64.so` +[Releases](https://github.com/jackalLabs/canine-chain-chain/releases) and download the latest release. Move the executable to a folder in your `$PATH` and download [this](https://github.com/CosmWasm/wasmvm/raw/v1.1.1/internal/api/libwasmvm.x86_64.so) to `/lib/libwasmvm.x86_64.so` ```sh sudo wget https://github.com/CosmWasm/wasmvm/raw/v1.1.1/internal/api/libwasmvm.x86_64.so -O /lib/libwasmvm.x86_64.so @@ -33,6 +33,8 @@ You may also need to run `sudo chmod +x canined` inside the executables director ## Version Map +When Syncing, you **MUST** use the flag `--unsafe-skip-upgrades 118040` after `canined start` or else you will crash at height 118040. + |block height|canined version| |------------|---------------| |45381 |1.1.2 | diff --git a/app/app.go b/app/app.go index c42845a36..0c2b8c518 100644 --- a/app/app.go +++ b/app/app.go @@ -120,10 +120,11 @@ import ( rnsmodulekeeper "github.com/jackalLabs/canine-chain/x/rns/keeper" rnsmoduletypes "github.com/jackalLabs/canine-chain/x/rns/types" + storagemodule "github.com/jackalLabs/canine-chain/x/storage" + storagemodulekeeper "github.com/jackalLabs/canine-chain/x/storage/keeper" + storagemoduletypes "github.com/jackalLabs/canine-chain/x/storage/types" + /* - storagemodule "github.com/jackalLabs/canine-chain/x/storage" - storagemodulekeeper "github.com/jackalLabs/canine-chain/x/storage/keeper" - storagemoduletypes "github.com/jackalLabs/canine-chain/x/storage/types" dsigmodule "github.com/jackalLabs/canine-chain/x/dsig" dsigmodulekeeper "github.com/jackalLabs/canine-chain/x/dsig/keeper" @@ -238,8 +239,9 @@ var ( ica.AppModuleBasic{}, intertx.AppModuleBasic{}, rnsmodule.AppModuleBasic{}, + storagemodule.AppModuleBasic{}, + /* - storagemodule.AppModuleBasic{}, dsigmodule.AppModuleBasic{}, filetreemodule.AppModuleBasic{}, notificationsmodule.AppModuleBasic{}, @@ -258,8 +260,9 @@ var ( icatypes.ModuleName: nil, wasm.ModuleName: {authtypes.Burner}, rnsmoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking}, + storagemoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + /* - storagemoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner}, dsigmoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner}, */ } @@ -313,10 +316,10 @@ type JackalApp struct { scopedTransferKeeper capabilitykeeper.ScopedKeeper scopedWasmKeeper capabilitykeeper.ScopedKeeper - RnsKeeper rnsmodulekeeper.Keeper + RnsKeeper rnsmodulekeeper.Keeper + StorageKeeper storagemodulekeeper.Keeper /* - StorageKeeper storagemodulekeeper.Keeper DsigKeeper dsigmodulekeeper.Keeper FileTreeKeeper filetreemodulekeeper.Keeper @@ -362,9 +365,9 @@ func NewJackalApp( govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, feegrant.StoreKey, authzkeeper.StoreKey, wasm.StoreKey, icahosttypes.StoreKey, icacontrollertypes.StoreKey, intertxtypes.StoreKey, - rnsmoduletypes.StoreKey, + rnsmoduletypes.StoreKey, storagemoduletypes.StoreKey, /* - storagemoduletypes.StoreKey, dsigmoduletypes.StoreKey, filetreemoduletypes.StoreKey, + , dsigmoduletypes.StoreKey, filetreemoduletypes.StoreKey, notificationsmoduletypes.StoreKey, */ ) @@ -450,6 +453,7 @@ func NewJackalApp( authtypes.FeeCollectorName, // storagemoduletypes.ModuleName, ) + mintModule := mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, app.BankKeeper) app.distrKeeper = distrkeeper.NewKeeper( appCodec, @@ -600,15 +604,18 @@ func NewJackalApp( ) rnsModule := rnsmodule.NewAppModule(appCodec, app.RnsKeeper, app.AccountKeeper, app.BankKeeper) + app.StorageKeeper = *storagemodulekeeper.NewKeeper( + appCodec, + keys[storagemoduletypes.StoreKey], + keys[storagemoduletypes.MemStoreKey], + app.getSubspace(storagemoduletypes.ModuleName), + app.BankKeeper, + app.AccountKeeper, + ) + storageModule := storagemodule.NewAppModule(appCodec, app.StorageKeeper, app.AccountKeeper, app.BankKeeper) + /* - app.StorageKeeper = *storagemodulekeeper.NewKeeper( - appCodec, - keys[storagemoduletypes.StoreKey], - keys[storagemoduletypes.MemStoreKey], - app.getSubspace(storagemoduletypes.ModuleName), - app.BankKeeper, - ) - storageModule := storagemodule.NewAppModule(appCodec, app.StorageKeeper, app.AccountKeeper, app.BankKeeper) + app.DsigKeeper = *dsigmodulekeeper.NewKeeper( appCodec, @@ -684,7 +691,7 @@ func NewJackalApp( bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), capability.NewAppModule(appCodec, *app.capabilityKeeper), gov.NewAppModule(appCodec, app.govKeeper, app.AccountKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, app.BankKeeper), + mintModule, slashing.NewAppModule(appCodec, app.slashingKeeper, app.AccountKeeper, app.BankKeeper, app.stakingKeeper), distr.NewAppModule(appCodec, app.distrKeeper, app.AccountKeeper, app.BankKeeper, app.stakingKeeper), staking.NewAppModule(appCodec, app.stakingKeeper, app.AccountKeeper, app.BankKeeper), @@ -700,8 +707,8 @@ func NewJackalApp( interTxModule, crisis.NewAppModule(&app.crisisKeeper, skipGenesisInvariants), // always be last to make sure that it checks for all invariants and not only part of them rnsModule, + storageModule, /* - storageModule, dsigModule, filetreeModule, notificationsModule, @@ -736,8 +743,8 @@ func NewJackalApp( intertxtypes.ModuleName, wasm.ModuleName, rnsmoduletypes.ModuleName, + storagemoduletypes.ModuleName, /* - storagemoduletypes.ModuleName, dsigmoduletypes.ModuleName, filetreemoduletypes.ModuleName, notificationsmoduletypes.ModuleName, @@ -768,8 +775,8 @@ func NewJackalApp( intertxtypes.ModuleName, wasm.ModuleName, rnsmoduletypes.ModuleName, + storagemoduletypes.ModuleName, /* - storagemoduletypes.ModuleName, dsigmoduletypes.ModuleName, filetreemoduletypes.ModuleName, notificationsmoduletypes.ModuleName, @@ -808,14 +815,42 @@ func NewJackalApp( // wasm after ibc transfer wasm.ModuleName, rnsmoduletypes.ModuleName, + storagemoduletypes.ModuleName, /* - storagemoduletypes.ModuleName, dsigmoduletypes.ModuleName, filetreemoduletypes.ModuleName, notificationsmoduletypes.ModuleName, */ ) + app.mm.SetOrderExportGenesis( + capabilitytypes.ModuleName, + authtypes.ModuleName, + banktypes.ModuleName, + distrtypes.ModuleName, + stakingtypes.ModuleName, + slashingtypes.ModuleName, + govtypes.ModuleName, + minttypes.ModuleName, + crisistypes.ModuleName, + genutiltypes.ModuleName, + evidencetypes.ModuleName, + authz.ModuleName, + feegrant.ModuleName, + paramstypes.ModuleName, + upgradetypes.ModuleName, + vestingtypes.ModuleName, + // additional non simd modules + ibctransfertypes.ModuleName, + ibchost.ModuleName, + icatypes.ModuleName, + intertxtypes.ModuleName, + // wasm after ibc transfer + wasm.ModuleName, + rnsmoduletypes.ModuleName, + storagemoduletypes.ModuleName, + ) + // Uncomment if you want to set a custom migration order here. // app.mm.SetOrderMigrations(custom order) @@ -846,7 +881,7 @@ func NewJackalApp( ibc.NewAppModule(app.ibcKeeper), transferModule, rnsModule, - // storageModule, + storageModule, ) app.sm.RegisterStoreDecoders() diff --git a/go.mod b/go.mod index f8493f14d..d354b61a2 100644 --- a/go.mod +++ b/go.mod @@ -4,33 +4,36 @@ go 1.19 require ( github.com/CosmWasm/wasmd v0.29.2 - github.com/cosmos/cosmos-sdk v0.45.10 + github.com/cosmos/cosmos-sdk v0.45.11 github.com/cosmos/ibc-go/v3 v3.4.0 github.com/cosmos/interchain-accounts v0.1.0 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/prometheus/client_golang v1.13.0 + github.com/prometheus/client_golang v1.14.0 github.com/rakyll/statik v0.1.7 github.com/rs/cors v1.8.2 // indirect github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa github.com/spf13/cast v1.5.0 - github.com/spf13/cobra v1.5.0 + github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect - github.com/tendermint/tendermint v0.34.22 + github.com/tendermint/tendermint v0.34.23 github.com/tendermint/tm-db v0.6.7 + github.com/wealdtech/go-merkletree v1.0.0 + github.com/zondax/ledger-go v0.13.0 // indirect google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a google.golang.org/grpc v1.50.1 gopkg.in/yaml.v2 v2.4.0 + ) require ( github.com/CosmWasm/wasmvm v1.1.1 // indirect github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect - github.com/cosmos/gogoproto v1.4.2 + github.com/cosmos/gogoproto v1.4.3 github.com/cosmos/iavl v0.19.4 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect @@ -41,12 +44,11 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/regen-network/cosmos-proto v0.3.1 // indirect github.com/spf13/viper v1.13.0 // indirect - github.com/zondax/ledger-go v0.12.2 // indirect golang.org/x/exp v0.0.0-20221019170559-20944726eadf // indirect ) require ( - cosmossdk.io/api v0.2.3 + cosmossdk.io/api v0.2.4 cosmossdk.io/core v0.3.2 github.com/golang/mock v1.6.0 ) @@ -54,6 +56,7 @@ require ( require ( cosmossdk.io/depinject v1.0.0-alpha.3 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect + github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect @@ -99,8 +102,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect - github.com/klauspost/compress v1.15.9 // indirect + github.com/klauspost/compress v1.15.11 // indirect github.com/lib/pq v1.10.6 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/magiconair/properties v1.8.6 // indirect @@ -116,7 +118,7 @@ require ( github.com/pelletier/go-toml/v2 v2.0.5 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect @@ -130,12 +132,12 @@ require ( github.com/tendermint/go-amino v0.16.0 // indirect github.com/zondax/hid v0.9.0 // indirect go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect - golang.org/x/net v0.0.0-20221017152216-f25eb7ecb193 // indirect - golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 // indirect - golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect - golang.org/x/text v0.3.8 // indirect - google.golang.org/protobuf v1.28.1 // indirect + golang.org/x/crypto v0.1.0 // indirect + golang.org/x/net v0.1.0 // indirect + golang.org/x/sys v0.1.0 // indirect + golang.org/x/term v0.1.0 // indirect + golang.org/x/text v0.4.0 // indirect + google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect @@ -144,7 +146,7 @@ require ( replace ( // use cosmos keyring - github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 + github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // dragonberry ics23 patch github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 diff --git a/go.sum b/go.sum index 06df7635c..088a0e8d7 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= -cosmossdk.io/api v0.2.3 h1:WtjmTmVIC7c/3ZVguaAcuoEQvsOHQjKk/1k1Fbxz9vA= -cosmossdk.io/api v0.2.3/go.mod h1:7xfxe8ghXHoKj3W2oG/HcuxGVwUHN3q8piiIEiJ3CEU= +cosmossdk.io/api v0.2.4 h1:o2t77GXWWEN5egCzD2ZyyFgbsoAif/XdF3T+/sAYiHQ= +cosmossdk.io/api v0.2.4/go.mod h1:7xfxe8ghXHoKj3W2oG/HcuxGVwUHN3q8piiIEiJ3CEU= cosmossdk.io/core v0.3.2 h1:KlQIufpJHJvOs7YLGTZsZcCo1WlkencDXepsr8STKZQ= cosmossdk.io/core v0.3.2/go.mod h1:CO7vbe+evrBvHc0setFHL/u7nlY7HJGzdRSBkT/sirc= cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= @@ -49,6 +49,8 @@ filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmG filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= @@ -65,7 +67,7 @@ github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= +github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -186,15 +188,15 @@ github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= -github.com/cosmos/cosmos-sdk v0.45.10 h1:YRf1N6C7OFCc8FJ5wuhcnDDySJNDn5DxSscVgbeXgz4= -github.com/cosmos/cosmos-sdk v0.45.10/go.mod h1:CbfWNs4PuxxsvRD/snQuSBDwIhtsD7rIDTVQyYMKTa0= +github.com/cosmos/cosmos-sdk v0.45.11 h1:Pc44fFEkai0KXFND5Ys/2ZJkfVdstMIBzKBN8MY7Ll0= +github.com/cosmos/cosmos-sdk v0.45.11/go.mod h1:45z8Q1Ah4iypFycu2Kl4kBPIsQKUiND8G2CUX+HTtPM= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cosmos/gogoproto v1.4.2 h1:UeGRcmFW41l0G0MiefWhkPEVEwvu78SZsHBvI78dAYw= -github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= +github.com/cosmos/gogoproto v1.4.3 h1:RP3yyVREh9snv/lsOvmsAPQt8f44LgL281X0IOIhhcI= +github.com/cosmos/gogoproto v1.4.3/go.mod h1:0hLIG5TR7IvV1fme1HCFKjfzW9X2x0Mo+RooWXCnOWU= github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok= @@ -203,8 +205,8 @@ github.com/cosmos/ibc-go/v3 v3.4.0 h1:ha3cqEG36pqMWqA1D+kxDWBTZXpeFMd/aZIQF7I0xr github.com/cosmos/ibc-go/v3 v3.4.0/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= github.com/cosmos/interchain-accounts v0.1.0 h1:QmuwNsf1Hxl3P5GSGt7Z+JeuHPiZw4Z34R/038P5T6s= github.com/cosmos/interchain-accounts v0.1.0/go.mod h1:Fv6LXDs+0ng4mIDVWwEJMXbAIMxY4kiq+A7Bw1Fb9AY= -github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= -github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= +github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= +github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.11.2-0.20220811092532-036a277666f3 h1:BhuqnpAyHPHaVvcQ+Da9wiKvDLODugAsVUdUItMatLQ= github.com/cosmos/ledger-cosmos-go v0.11.2-0.20220811092532-036a277666f3/go.mod h1:73XF1lkyjA304gibbj6wc7FjuPDu+wEF0FSzOcdhptQ= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= @@ -217,7 +219,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= -github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= @@ -250,14 +251,13 @@ github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/ github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac h1:opbrjaN/L8gg6Xh5D04Tem+8xVcz6ajZlGCs49mQgyg= github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= @@ -341,7 +341,7 @@ github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+ github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= +github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= @@ -546,8 +546,6 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= -github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= @@ -555,8 +553,8 @@ github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0 github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= -github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= +github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= @@ -684,7 +682,7 @@ github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 h1:rc3tiVYb5z54aKaDfakKn0dDjIyPpTtszkjuMzyt7ec= +github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= @@ -737,15 +735,16 @@ github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3O github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= -github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -829,8 +828,8 @@ github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= -github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= +github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -847,7 +846,6 @@ github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3 github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -872,8 +870,8 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RM github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/tendermint v0.34.22 h1:XMhtC8s8QqJO4l/dn+TkQvevTRSow3Vixjclr41o+2Q= -github.com/tendermint/tendermint v0.34.22/go.mod h1:YpP5vBEAKUT4g6oyfjKgFeZmdB/GjkJAxfF+cgmJg6Y= +github.com/tendermint/tendermint v0.34.23 h1:JZYsdc59aOiT5efou+BHILJv8x6FlRyvlor84Xq9Tb0= +github.com/tendermint/tendermint v0.34.23/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI= github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -903,6 +901,8 @@ github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPU github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/wealdtech/go-merkletree v1.0.0 h1:DsF1xMzj5rK3pSQM6mPv8jlyJyHXhFxpnA2bwEjMMBY= +github.com/wealdtech/go-merkletree v1.0.0/go.mod h1:cdil512d/8ZC7Kx3bfrDvGMQXB25NTKbsm0rFrmDax4= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= @@ -915,8 +915,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.12.2 h1:HnuUEKylJ6GqNrLMwghCTHRRAsnr8NlriawMVaFZ7w0= -github.com/zondax/ledger-go v0.12.2/go.mod h1:KatxXrVDzgWwbssUWsF5+cOJHXPvzQ09YSlzGNuhOEo= +github.com/zondax/ledger-go v0.13.0 h1:3brWtvAlfKqpe27JSUC/t1f0CvVVOX8zR/f/3+ShPBY= +github.com/zondax/ledger-go v0.13.0/go.mod h1:KatxXrVDzgWwbssUWsF5+cOJHXPvzQ09YSlzGNuhOEo= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= @@ -960,8 +960,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1002,6 +1002,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1055,8 +1056,8 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20221017152216-f25eb7ecb193 h1:3Moaxt4TfzNcQH6DWvlYKraN1ozhBXQHcgvXjRGeim0= -golang.org/x/net v0.0.0-20221017152216-f25eb7ecb193/go.mod h1:RpDiru2p0u2F0lLpEoqnP2+7xs0ifAuOcJ442g6GU2s= +golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1098,7 +1099,6 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1162,13 +1162,13 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 h1:OK7RB6t2WQX54srQQYSXMW8dF5C6/8+oA/s5QBmmto4= -golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc= -golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1178,8 +1178,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1245,6 +1245,7 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1343,8 +1344,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= +google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/ls/config/app.toml b/ls/config/app.toml deleted file mode 100644 index 803d71524..000000000 --- a/ls/config/app.toml +++ /dev/null @@ -1,196 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -############################################################################### -### Base Configuration ### -############################################################################### - -# The minimum gas prices a validator is willing to accept for processing a -# transaction. A transaction's fees must meet the minimum of any denomination -# specified in this config (e.g. 0.25token1;0.0001token2). -minimum-gas-prices = "" - -# default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals -# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) -# everything: all saved states will be deleted, storing only the current and previous state; pruning at 10 block intervals -# custom: allow pruning options to be manually specified through 'pruning-keep-recent', 'pruning-keep-every', and 'pruning-interval' -pruning = "default" - -# These are applied if and only if the pruning strategy is custom. -pruning-keep-recent = "0" -pruning-keep-every = "0" -pruning-interval = "0" - -# HaltHeight contains a non-zero block height at which a node will gracefully -# halt and shutdown that can be used to assist upgrades and testing. -# -# Note: Commitment of state will be attempted on the corresponding block. -halt-height = 0 - -# HaltTime contains a non-zero minimum block time (in Unix seconds) at which -# a node will gracefully halt and shutdown that can be used to assist upgrades -# and testing. -# -# Note: Commitment of state will be attempted on the corresponding block. -halt-time = 0 - -# MinRetainBlocks defines the minimum block height offset from the current -# block being committed, such that all blocks past this offset are pruned -# from Tendermint. It is used as part of the process of determining the -# ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates -# that no blocks should be pruned. -# -# This configuration value is only responsible for pruning Tendermint blocks. -# It has no bearing on application state pruning which is determined by the -# "pruning-*" configurations. -# -# Note: Tendermint block pruning is dependant on this parameter in conunction -# with the unbonding (safety threshold) period, state pruning and state sync -# snapshot parameters to determine the correct minimum value of -# ResponseCommit.RetainHeight. -min-retain-blocks = 0 - -# InterBlockCache enables inter-block caching. -inter-block-cache = true - -# IndexEvents defines the set of events in the form {eventType}.{attributeKey}, -# which informs Tendermint what to index. If empty, all events will be indexed. -# -# Example: -# ["message.sender", "message.recipient"] -index-events = [] - -# IavlCacheSize set the size of the iavl tree cache. -# Default cache size is 50mb. -iavl-cache-size = 781250 - -############################################################################### -### Telemetry Configuration ### -############################################################################### - -[telemetry] - -# Prefixed with keys to separate services. -service-name = "" - -# Enabled enables the application telemetry functionality. When enabled, -# an in-memory sink is also enabled by default. Operators may also enabled -# other sinks such as Prometheus. -enabled = false - -# Enable prefixing gauge values with hostname. -enable-hostname = false - -# Enable adding hostname to labels. -enable-hostname-label = false - -# Enable adding service to labels. -enable-service-label = false - -# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. -prometheus-retention-time = 0 - -# GlobalLabels defines a global set of name/value label tuples applied to all -# metrics emitted using the wrapper functions defined in telemetry package. -# -# Example: -# [["chain_id", "cosmoshub-1"]] -global-labels = [ -] - -############################################################################### -### API Configuration ### -############################################################################### - -[api] - -# Enable defines if the API server should be enabled. -enable = false - -# Swagger defines if swagger documentation should automatically be registered. -swagger = false - -# Address defines the API server to listen on. -address = "tcp://0.0.0.0:1317" - -# MaxOpenConnections defines the number of maximum open connections. -max-open-connections = 1000 - -# RPCReadTimeout defines the Tendermint RPC read timeout (in seconds). -rpc-read-timeout = 10 - -# RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds). -rpc-write-timeout = 0 - -# RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes). -rpc-max-body-bytes = 1000000 - -# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). -enabled-unsafe-cors = false - -############################################################################### -### Rosetta Configuration ### -############################################################################### - -[rosetta] - -# Enable defines if the Rosetta API server should be enabled. -enable = false - -# Address defines the Rosetta API server to listen on. -address = ":8080" - -# Network defines the name of the blockchain that will be returned by Rosetta. -blockchain = "app" - -# Network defines the name of the network that will be returned by Rosetta. -network = "network" - -# Retries defines the number of retries when connecting to the node before failing. -retries = 3 - -# Offline defines if Rosetta server should run in offline mode. -offline = false - -############################################################################### -### gRPC Configuration ### -############################################################################### - -[grpc] - -# Enable defines if the gRPC server should be enabled. -enable = true - -# Address defines the gRPC server address to bind to. -address = "0.0.0.0:9090" - -############################################################################### -### gRPC Web Configuration ### -############################################################################### - -[grpc-web] - -# GRPCWebEnable defines if the gRPC-web should be enabled. -# NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op. -enable = true - -# Address defines the gRPC-web server address to bind to. -address = "0.0.0.0:9091" - -# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). -enable-unsafe-cors = false - -############################################################################### -### State Sync Configuration ### -############################################################################### - -# State sync snapshots allow other nodes to rapidly join the network without replaying historical -# blocks, instead downloading and applying a snapshot of the application state at a given height. -[state-sync] - -# snapshot-interval specifies the block interval at which local state sync snapshots are -# taken (0 to disable). Must be a multiple of pruning-keep-every. -snapshot-interval = 0 - -# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). -snapshot-keep-recent = 2 diff --git a/ls/config/client.toml b/ls/config/client.toml deleted file mode 100644 index 222695a3f..000000000 --- a/ls/config/client.toml +++ /dev/null @@ -1,17 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -############################################################################### -### Client Configuration ### -############################################################################### - -# The network chain ID -chain-id = "" -# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) -keyring-backend = "os" -# CLI output format (text|json) -output = "text" -# : to Tendermint RPC interface for this chain -node = "tcp://localhost:26657" -# Transaction broadcasting mode (sync|async|block) -broadcast-mode = "sync" diff --git a/ls/config/config.toml b/ls/config/config.toml deleted file mode 100644 index 375e302d0..000000000 --- a/ls/config/config.toml +++ /dev/null @@ -1,428 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -# NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or -# relative to the home directory (e.g. "data"). The home directory is -# "$HOME/.tendermint" by default, but could be changed via $TMHOME env variable -# or --home cmd flag. - -####################################################################### -### Main Base Config Options ### -####################################################################### - -# TCP or UNIX socket address of the ABCI application, -# or the name of an ABCI application compiled in with the Tendermint binary -proxy_app = "tcp://127.0.0.1:26658" - -# A custom human readable name for this node -moniker = "Marstons-MacBook-Air.local" - -# If this node is many blocks behind the tip of the chain, FastSync -# allows them to catchup quickly by downloading blocks in parallel -# and verifying their commits -fast_sync = true - -# Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb -# * goleveldb (github.com/syndtr/goleveldb - most popular implementation) -# - pure go -# - stable -# * cleveldb (uses levigo wrapper) -# - fast -# - requires gcc -# - use cleveldb build tag (go build -tags cleveldb) -# * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt) -# - EXPERIMENTAL -# - may be faster is some use-cases (random reads - indexer) -# - use boltdb build tag (go build -tags boltdb) -# * rocksdb (uses github.com/tecbot/gorocksdb) -# - EXPERIMENTAL -# - requires gcc -# - use rocksdb build tag (go build -tags rocksdb) -# * badgerdb (uses github.com/dgraph-io/badger) -# - EXPERIMENTAL -# - use badgerdb build tag (go build -tags badgerdb) -db_backend = "goleveldb" - -# Database directory -db_dir = "data" - -# Output level for logging, including package level options -log_level = "info" - -# Output format: 'plain' (colored text) or 'json' -log_format = "plain" - -##### additional base config options ##### - -# Path to the JSON file containing the initial validator set and other meta data -genesis_file = "config/genesis.json" - -# Path to the JSON file containing the private key to use as a validator in the consensus protocol -priv_validator_key_file = "config/priv_validator_key.json" - -# Path to the JSON file containing the last sign state of a validator -priv_validator_state_file = "data/priv_validator_state.json" - -# TCP or UNIX socket address for Tendermint to listen on for -# connections from an external PrivValidator process -priv_validator_laddr = "" - -# Path to the JSON file containing the private key to use for node authentication in the p2p protocol -node_key_file = "config/node_key.json" - -# Mechanism to connect to the ABCI application: socket | grpc -abci = "socket" - -# If true, query the ABCI app on connecting to a new peer -# so the app can decide if we should keep the connection or not -filter_peers = false - - -####################################################################### -### Advanced Configuration Options ### -####################################################################### - -####################################################### -### RPC Server Configuration Options ### -####################################################### -[rpc] - -# TCP or UNIX socket address for the RPC server to listen on -laddr = "tcp://127.0.0.1:26657" - -# A list of origins a cross-domain request can be executed from -# Default value '[]' disables cors support -# Use '["*"]' to allow any origin -cors_allowed_origins = [] - -# A list of methods the client is allowed to use with cross-domain requests -cors_allowed_methods = ["HEAD", "GET", "POST", ] - -# A list of non simple headers the client is allowed to use with cross-domain requests -cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ] - -# TCP or UNIX socket address for the gRPC server to listen on -# NOTE: This server only supports /broadcast_tx_commit -grpc_laddr = "" - -# Maximum number of simultaneous connections. -# Does not include RPC (HTTP&WebSocket) connections. See max_open_connections -# If you want to accept a larger number than the default, make sure -# you increase your OS limits. -# 0 - unlimited. -# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} -# 1024 - 40 - 10 - 50 = 924 = ~900 -grpc_max_open_connections = 900 - -# Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool -unsafe = false - -# Maximum number of simultaneous connections (including WebSocket). -# Does not include gRPC connections. See grpc_max_open_connections -# If you want to accept a larger number than the default, make sure -# you increase your OS limits. -# 0 - unlimited. -# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} -# 1024 - 40 - 10 - 50 = 924 = ~900 -max_open_connections = 900 - -# Maximum number of unique clientIDs that can /subscribe -# If you're using /broadcast_tx_commit, set to the estimated maximum number -# of broadcast_tx_commit calls per block. -max_subscription_clients = 100 - -# Maximum number of unique queries a given client can /subscribe to -# If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to -# the estimated # maximum number of broadcast_tx_commit calls per block. -max_subscriptions_per_client = 5 - -# Experimental parameter to specify the maximum number of events a node will -# buffer, per subscription, before returning an error and closing the -# subscription. Must be set to at least 100, but higher values will accommodate -# higher event throughput rates (and will use more memory). -experimental_subscription_buffer_size = 200 - -# Experimental parameter to specify the maximum number of RPC responses that -# can be buffered per WebSocket client. If clients cannot read from the -# WebSocket endpoint fast enough, they will be disconnected, so increasing this -# parameter may reduce the chances of them being disconnected (but will cause -# the node to use more memory). -# -# Must be at least the same as "experimental_subscription_buffer_size", -# otherwise connections could be dropped unnecessarily. This value should -# ideally be somewhat higher than "experimental_subscription_buffer_size" to -# accommodate non-subscription-related RPC responses. -experimental_websocket_write_buffer_size = 200 - -# If a WebSocket client cannot read fast enough, at present we may -# silently drop events instead of generating an error or disconnecting the -# client. -# -# Enabling this experimental parameter will cause the WebSocket connection to -# be closed instead if it cannot read fast enough, allowing for greater -# predictability in subscription behaviour. -experimental_close_on_slow_client = false - -# How long to wait for a tx to be committed during /broadcast_tx_commit. -# WARNING: Using a value larger than 10s will result in increasing the -# global HTTP write timeout, which applies to all connections and endpoints. -# See https://github.com/tendermint/tendermint/issues/3435 -timeout_broadcast_tx_commit = "10s" - -# Maximum size of request body, in bytes -max_body_bytes = 1000000 - -# Maximum size of request header, in bytes -max_header_bytes = 1048576 - -# The path to a file containing certificate that is used to create the HTTPS server. -# Might be either absolute path or path related to Tendermint's config directory. -# If the certificate is signed by a certificate authority, -# the certFile should be the concatenation of the server's certificate, any intermediates, -# and the CA's certificate. -# NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server. -# Otherwise, HTTP server is run. -tls_cert_file = "" - -# The path to a file containing matching private key that is used to create the HTTPS server. -# Might be either absolute path or path related to Tendermint's config directory. -# NOTE: both tls-cert-file and tls-key-file must be present for Tendermint to create HTTPS server. -# Otherwise, HTTP server is run. -tls_key_file = "" - -# pprof listen address (https://golang.org/pkg/net/http/pprof) -pprof_laddr = "localhost:6060" - -####################################################### -### P2P Configuration Options ### -####################################################### -[p2p] - -# Address to listen for incoming connections -laddr = "tcp://0.0.0.0:26656" - -# Address to advertise to peers for them to dial -# If empty, will use the same port as the laddr, -# and will introspect on the listener or use UPnP -# to figure out the address. ip and port are required -# example: 159.89.10.97:26656 -external_address = "" - -# Comma separated list of seed nodes to connect to -seeds = "" - -# Comma separated list of nodes to keep persistent connections to -persistent_peers = "" - -# UPNP port forwarding -upnp = false - -# Path to address book -addr_book_file = "config/addrbook.json" - -# Set true for strict address routability rules -# Set false for private or local networks -addr_book_strict = true - -# Maximum number of inbound peers -max_num_inbound_peers = 40 - -# Maximum number of outbound peers to connect to, excluding persistent peers -max_num_outbound_peers = 10 - -# List of node IDs, to which a connection will be (re)established ignoring any existing limits -unconditional_peer_ids = "" - -# Maximum pause when redialing a persistent peer (if zero, exponential backoff is used) -persistent_peers_max_dial_period = "0s" - -# Time to wait before flushing messages out on the connection -flush_throttle_timeout = "100ms" - -# Maximum size of a message packet payload, in bytes -max_packet_msg_payload_size = 1024 - -# Rate at which packets can be sent, in bytes/second -send_rate = 5120000 - -# Rate at which packets can be received, in bytes/second -recv_rate = 5120000 - -# Set true to enable the peer-exchange reactor -pex = true - -# Seed mode, in which node constantly crawls the network and looks for -# peers. If another node asks it for addresses, it responds and disconnects. -# -# Does not work if the peer-exchange reactor is disabled. -seed_mode = false - -# Comma separated list of peer IDs to keep private (will not be gossiped to other peers) -private_peer_ids = "" - -# Toggle to disable guard against peers connecting from the same ip. -allow_duplicate_ip = false - -# Peer connection configuration. -handshake_timeout = "20s" -dial_timeout = "3s" - -####################################################### -### Mempool Configuration Option ### -####################################################### -[mempool] - -recheck = true -broadcast = true -wal_dir = "" - -# Maximum number of transactions in the mempool -size = 5000 - -# Limit the total size of all txs in the mempool. -# This only accounts for raw transactions (e.g. given 1MB transactions and -# max_txs_bytes=5MB, mempool will only accept 5 transactions). -max_txs_bytes = 1073741824 - -# Size of the cache (used to filter transactions we saw earlier) in transactions -cache_size = 10000 - -# Do not remove invalid transactions from the cache (default: false) -# Set to true if it's not possible for any invalid transaction to become valid -# again in the future. -keep-invalid-txs-in-cache = false - -# Maximum size of a single transaction. -# NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}. -max_tx_bytes = 1048576 - -# Maximum size of a batch of transactions to send to a peer -# Including space needed by encoding (one varint per transaction). -# XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796 -max_batch_bytes = 0 - -####################################################### -### State Sync Configuration Options ### -####################################################### -[statesync] -# State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine -# snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in -# the network to take and serve state machine snapshots. State sync is not attempted if the node -# has any local state (LastBlockHeight > 0). The node will have a truncated block history, -# starting from the height of the snapshot. -enable = false - -# RPC servers (comma-separated) for light client verification of the synced state machine and -# retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding -# header hash obtained from a trusted source, and a period during which validators can be trusted. -# -# For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2 -# weeks) during which they can be financially punished (slashed) for misbehavior. -rpc_servers = "" -trust_height = 0 -trust_hash = "" -trust_period = "168h0m0s" - -# Time to spend discovering snapshots before initiating a restore. -discovery_time = "15s" - -# Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp). -# Will create a new, randomly named directory within, and remove it when done. -temp_dir = "" - -# The timeout duration before re-requesting a chunk, possibly from a different -# peer (default: 1 minute). -chunk_request_timeout = "10s" - -# The number of concurrent chunk fetchers to run (default: 1). -chunk_fetchers = "4" - -####################################################### -### Fast Sync Configuration Connections ### -####################################################### -[fastsync] - -# Fast Sync version to use: -# 1) "v0" (default) - the legacy fast sync implementation -# 2) "v1" - refactor of v0 version for better testability -# 2) "v2" - complete redesign of v0, optimized for testability & readability -version = "v0" - -####################################################### -### Consensus Configuration Options ### -####################################################### -[consensus] - -wal_file = "data/cs.wal/wal" - -# How long we wait for a proposal block before prevoting nil -timeout_propose = "3s" -# How much timeout_propose increases with each round -timeout_propose_delta = "500ms" -# How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil) -timeout_prevote = "1s" -# How much the timeout_prevote increases with each round -timeout_prevote_delta = "500ms" -# How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil) -timeout_precommit = "1s" -# How much the timeout_precommit increases with each round -timeout_precommit_delta = "500ms" -# How long we wait after committing a block, before starting on the new -# height (this gives us a chance to receive some more precommits, even -# though we already have +2/3). -timeout_commit = "5s" - -# How many blocks to look back to check existence of the node's consensus votes before joining consensus -# When non-zero, the node will panic upon restart -# if the same consensus key was used to sign {double_sign_check_height} last blocks. -# So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic. -double_sign_check_height = 0 - -# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0) -skip_timeout_commit = false - -# EmptyBlocks mode and possible interval between empty blocks -create_empty_blocks = true -create_empty_blocks_interval = "0s" - -# Reactor sleep duration parameters -peer_gossip_sleep_duration = "100ms" -peer_query_maj23_sleep_duration = "2s" - -####################################################### -### Transaction Indexer Configuration Options ### -####################################################### -[tx_index] - -# What indexer to use for transactions -# -# The application will set which txs to index. In some cases a node operator will be able -# to decide which txs to index based on configuration set in the application. -# -# Options: -# 1) "null" -# 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). -# - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed. -indexer = "kv" - -####################################################### -### Instrumentation Configuration Options ### -####################################################### -[instrumentation] - -# When true, Prometheus metrics are served under /metrics on -# PrometheusListenAddr. -# Check out the documentation for the list of available metrics. -prometheus = false - -# Address to listen for Prometheus collector(s) connections -prometheus_listen_addr = ":26660" - -# Maximum number of simultaneous connections. -# If you want to accept a larger number than the default, make sure -# you increase your OS limits. -# 0 - unlimited. -max_open_connections = 3 - -# Instrumentation namespace -namespace = "tendermint" diff --git a/proto/buf.lock b/proto/buf.lock index 763e0eb83..66dddac14 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -8,7 +8,7 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-sdk - commit: c280f3b1d0464abaa746f8080bb9a114 + commit: 1ed0a12554094cc4847d1850839a5035 - remote: buf.build owner: cosmos repository: gogo-proto diff --git a/proto/buf.md b/proto/buf.md index 2f4c56f3b..974d7221f 100644 --- a/proto/buf.md +++ b/proto/buf.md @@ -1,3 +1,3 @@ # Protobufs -This is the public protocol buffers API for [Wasmd](https://github.com/jackal-dao/canine). \ No newline at end of file +This is the public protocol buffers API for [Wasmd](https://github.com/jackalLabs/canine-chain). \ No newline at end of file diff --git a/proto/canine-chain/jklmint/genesis.proto b/proto/canine-chain/jklmint/genesis.proto index f5c354d3f..cb9c15fac 100644 --- a/proto/canine-chain/jklmint/genesis.proto +++ b/proto/canine-chain/jklmint/genesis.proto @@ -7,6 +7,4 @@ import "canine-chain/jklmint/params.proto"; option go_package = "github.com/jackal-dao/canine/x/jklmint/types"; // GenesisState defines the jklmint module's genesis state. -message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; -} +message GenesisState { Params params = 1 [ (gogoproto.nullable) = false ]; } diff --git a/proto/canine-chain/jklmint/params.proto b/proto/canine-chain/jklmint/params.proto index 09b8b0dff..99b022a2e 100644 --- a/proto/canine-chain/jklmint/params.proto +++ b/proto/canine-chain/jklmint/params.proto @@ -8,6 +8,6 @@ option go_package = "github.com/jackal-dao/canine/x/jklmint/types"; // Params defines the parameters for the module. message Params { option (gogoproto.goproto_stringer) = false; - - string mintDenom = 1 [(gogoproto.moretags) = "yaml:\"mint_denom\""]; + + string mintDenom = 1 [ (gogoproto.moretags) = "yaml:\"mint_denom\"" ]; } \ No newline at end of file diff --git a/proto/canine-chain/jklmint/query.proto b/proto/canine-chain/jklmint/query.proto index 24c4a1015..a31433b51 100644 --- a/proto/canine-chain/jklmint/query.proto +++ b/proto/canine-chain/jklmint/query.proto @@ -12,14 +12,13 @@ option go_package = "github.com/jackal-dao/canine/x/jklmint/types"; service Query { // Parameters queries the parameters of the module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/params"; + option (google.api.http).get = "/jackal-dao/canine/jklmint/params"; } // Inflation returns the current minting inflation value. rpc Inflation(QueryInflationRequest) returns (QueryInflationResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/inflation"; + option (google.api.http).get = "/jackal-dao/canine/jklmint/inflation"; } - } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -28,7 +27,7 @@ message QueryParamsRequest {} // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; + Params params = 1 [ (gogoproto.nullable) = false ]; } // QueryInflationRequest is the request type for the Query/Inflation RPC method. @@ -38,6 +37,8 @@ message QueryInflationRequest {} // method. message QueryInflationResponse { // inflation is the current minting inflation value. - bytes inflation = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes inflation = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } - diff --git a/proto/canine-chain/jklmint/tx.proto b/proto/canine-chain/jklmint/tx.proto index 2436557e0..2d5bec793 100644 --- a/proto/canine-chain/jklmint/tx.proto +++ b/proto/canine-chain/jklmint/tx.proto @@ -1,9 +1,7 @@ syntax = "proto3"; package jackaldao.canine.jklmint; - option go_package = "github.com/jackal-dao/canine/x/jklmint/types"; // Msg defines the Msg service. -service Msg { -} +service Msg {} diff --git a/proto/canine-chain/rns/bids.proto b/proto/canine-chain/rns/bids.proto index 5a08f14ed..4aaa368dc 100644 --- a/proto/canine-chain/rns/bids.proto +++ b/proto/canine-chain/rns/bids.proto @@ -4,10 +4,8 @@ package jackaldao.canine.rns; option go_package = "github.com/jackal-dao/canine/x/rns/types"; message Bids { - string index = 1; - string name = 2; - string bidder = 3; - string price = 4; - + string index = 1; + string name = 2; + string bidder = 3; + string price = 4; } - diff --git a/proto/canine-chain/rns/forsale.proto b/proto/canine-chain/rns/forsale.proto index 33ace0282..5b7f130b1 100644 --- a/proto/canine-chain/rns/forsale.proto +++ b/proto/canine-chain/rns/forsale.proto @@ -4,8 +4,7 @@ package jackaldao.canine.rns; option go_package = "github.com/jackal-dao/canine/x/rns/types"; message Forsale { - string name = 1; - string price = 2; + string name = 1; + string price = 2; string owner = 3; } - diff --git a/proto/canine-chain/rns/genesis.proto b/proto/canine-chain/rns/genesis.proto index b84025e0a..a41a7f02c 100644 --- a/proto/canine-chain/rns/genesis.proto +++ b/proto/canine-chain/rns/genesis.proto @@ -13,10 +13,10 @@ option go_package = "github.com/jackal-dao/canine/x/rns/types"; // GenesisState defines the rns module's genesis state. message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; - repeated Whois whoisList = 2 [(gogoproto.nullable) = false]; - repeated Names namesList = 3 [(gogoproto.nullable) = false]; - repeated Bids bidsList = 4 [(gogoproto.nullable) = false]; - repeated Forsale forsaleList = 5 [(gogoproto.nullable) = false]; - repeated Init initList = 6 [(gogoproto.nullable) = false]; + Params params = 1 [ (gogoproto.nullable) = false ]; + repeated Whois whoisList = 2 [ (gogoproto.nullable) = false ]; + repeated Names namesList = 3 [ (gogoproto.nullable) = false ]; + repeated Bids bidsList = 4 [ (gogoproto.nullable) = false ]; + repeated Forsale forsaleList = 5 [ (gogoproto.nullable) = false ]; + repeated Init initList = 6 [ (gogoproto.nullable) = false ]; } diff --git a/proto/canine-chain/rns/init.proto b/proto/canine-chain/rns/init.proto index 84f90a307..d94735958 100644 --- a/proto/canine-chain/rns/init.proto +++ b/proto/canine-chain/rns/init.proto @@ -4,8 +4,6 @@ package jackaldao.canine.rns; option go_package = "github.com/jackal-dao/canine/x/rns/types"; message Init { - string address = 1; - bool complete = 2; - + string address = 1; + bool complete = 2; } - diff --git a/proto/canine-chain/rns/names.proto b/proto/canine-chain/rns/names.proto index fd14e19df..603dbeac8 100644 --- a/proto/canine-chain/rns/names.proto +++ b/proto/canine-chain/rns/names.proto @@ -4,12 +4,11 @@ package jackaldao.canine.rns; option go_package = "github.com/jackal-dao/canine/x/rns/types"; message Names { - string name = 1; - int64 expires = 2; - string value = 3; - string data = 4; + string name = 1; + int64 expires = 2; + string value = 3; + string data = 4; repeated Names subdomains = 5; string tld = 6; int64 locked = 7; } - diff --git a/proto/canine-chain/rns/params.proto b/proto/canine-chain/rns/params.proto index d46260ee3..566912715 100644 --- a/proto/canine-chain/rns/params.proto +++ b/proto/canine-chain/rns/params.proto @@ -6,7 +6,4 @@ import "gogoproto/gogo.proto"; option go_package = "github.com/jackal-dao/canine/x/rns/types"; // Params defines the parameters for the module. -message Params { - option (gogoproto.goproto_stringer) = false; - -} \ No newline at end of file +message Params { option (gogoproto.goproto_stringer) = false; } \ No newline at end of file diff --git a/proto/canine-chain/rns/query.proto b/proto/canine-chain/rns/query.proto index 6ad95e2ac..db58a438f 100644 --- a/proto/canine-chain/rns/query.proto +++ b/proto/canine-chain/rns/query.proto @@ -17,54 +17,55 @@ option go_package = "github.com/jackal-dao/canine/x/rns/types"; service Query { // Parameters queries the parameters of the module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/jackal-dao/canine/rnsparams"; + option (google.api.http).get = "/jackal-dao/canine/rns/params"; } -// Queries a Name by index. - rpc Names(QueryGetNamesRequest) returns (QueryGetNamesResponse) { - option (google.api.http).get = "/jackal-dao/canine/rnsnames/{index}"; - } - - // Queries a list of Names. - rpc NamesAll(QueryAllNamesRequest) returns (QueryAllNamesResponse) { - option (google.api.http).get = "/jackal-dao/canine/rnsnames"; - } + // Queries a Name by index. + rpc Names(QueryGetNamesRequest) returns (QueryGetNamesResponse) { + option (google.api.http).get = "/jackal-dao/canine/rns/names/{index}"; + } -// Queries a Bid by index. - rpc Bids(QueryGetBidsRequest) returns (QueryGetBidsResponse) { - option (google.api.http).get = "/jackal-dao/canine/rnsbids/{index}"; - } + // Queries a list of Names. + rpc NamesAll(QueryAllNamesRequest) returns (QueryAllNamesResponse) { + option (google.api.http).get = "/jackal-dao/canine/rns/names"; + } - // Queries a list of Bids. - rpc BidsAll(QueryAllBidsRequest) returns (QueryAllBidsResponse) { - option (google.api.http).get = "/jackal-dao/canine/rnsbids"; - } + // Queries a Bid by index. + rpc Bids(QueryGetBidsRequest) returns (QueryGetBidsResponse) { + option (google.api.http).get = "/jackal-dao/canine/rns/bids/{index}"; + } -// Queries a Listing by index. - rpc Forsale(QueryGetForsaleRequest) returns (QueryGetForsaleResponse) { - option (google.api.http).get = "/jackal-dao/canine/rnsforsale/{name}"; - } + // Queries a list of Bids. + rpc BidsAll(QueryAllBidsRequest) returns (QueryAllBidsResponse) { + option (google.api.http).get = "/jackal-dao/canine/rns/bids"; + } - // Queries all Listings. - rpc ForsaleAll(QueryAllForsaleRequest) returns (QueryAllForsaleResponse) { - option (google.api.http).get = "/jackal-dao/canine/rnsforsale"; - } + // Queries a Listing by index. + rpc Forsale(QueryGetForsaleRequest) returns (QueryGetForsaleResponse) { + option (google.api.http).get = "/jackal-dao/canine/rns/forsale/{name}"; + } -// Queries a Init by index. - rpc Init(QueryGetInitRequest) returns (QueryGetInitResponse) { - option (google.api.http).get = "/jackal-dao/canine/rns/init/{address}"; - } + // Queries all Listings. + rpc ForsaleAll(QueryAllForsaleRequest) returns (QueryAllForsaleResponse) { + option (google.api.http).get = "/jackal-dao/canine/rns/forsale"; + } - // Queries a list of Init items. - rpc InitAll(QueryAllInitRequest) returns (QueryAllInitResponse) { - option (google.api.http).get = "/jackal-dao/canine/rns/init"; - } + // Queries a Init by index. + rpc Init(QueryGetInitRequest) returns (QueryGetInitResponse) { + option (google.api.http).get = "/jackal-dao/canine/rns/init/{address}"; + } -// Queries a list of ListOwnedNames items. - rpc ListOwnedNames(QueryListOwnedNamesRequest) returns (QueryListOwnedNamesResponse) { - option (google.api.http).get = "/jackal-dao/canine/rns/list_owned_names/{address}"; - } + // Queries a list of Init items. + rpc InitAll(QueryAllInitRequest) returns (QueryAllInitResponse) { + option (google.api.http).get = "/jackal-dao/canine/rns/init"; + } + // Queries a list of ListOwnedNames items. + rpc ListOwnedNames(QueryListOwnedNamesRequest) + returns (QueryListOwnedNamesResponse) { + option (google.api.http).get = + "/jackal-dao/canine/rns/list_owned_names/{address}"; + } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -73,106 +74,86 @@ message QueryParamsRequest {} // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; + Params params = 1 [ (gogoproto.nullable) = false ]; } -message QueryGetWhoisRequest { - string index = 1; - -} +message QueryGetWhoisRequest { string index = 1; } message QueryGetWhoisResponse { - Whois whois = 1 [(gogoproto.nullable) = false]; + Whois whois = 1 [ (gogoproto.nullable) = false ]; } message QueryAllWhoisRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 1; } message QueryAllWhoisResponse { - repeated Whois whois = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated Whois whois = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } -message QueryGetNamesRequest { - string index = 1; - -} +message QueryGetNamesRequest { string index = 1; } message QueryGetNamesResponse { - Names names = 1 [(gogoproto.nullable) = false]; + Names names = 1 [ (gogoproto.nullable) = false ]; } message QueryAllNamesRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 1; } message QueryAllNamesResponse { - repeated Names names = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated Names names = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } -message QueryGetBidsRequest { - string index = 1; - -} +message QueryGetBidsRequest { string index = 1; } -message QueryGetBidsResponse { - Bids bids = 1 [(gogoproto.nullable) = false]; -} +message QueryGetBidsResponse { Bids bids = 1 [ (gogoproto.nullable) = false ]; } message QueryAllBidsRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 1; } message QueryAllBidsResponse { - repeated Bids bids = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated Bids bids = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } -message QueryGetForsaleRequest { - string name = 1; - -} +message QueryGetForsaleRequest { string name = 1; } message QueryGetForsaleResponse { - Forsale forsale = 1 [(gogoproto.nullable) = false]; + Forsale forsale = 1 [ (gogoproto.nullable) = false ]; } message QueryAllForsaleRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 1; } message QueryAllForsaleResponse { - repeated Forsale forsale = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated Forsale forsale = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } -message QueryGetInitRequest { - string address = 1; +message QueryGetInitRequest { string address = 1; } -} - -message QueryGetInitResponse { - bool init = 1; -} +message QueryGetInitResponse { bool init = 1; } message QueryAllInitRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 1; } message QueryAllInitResponse { - repeated Init init = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated Init init = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } message QueryListOwnedNamesRequest { string address = 1; -cosmos.base.query.v1beta1.PageRequest pagination = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 2; } message QueryListOwnedNamesResponse { - repeated Names names = 1 [(gogoproto.nullable) = false]; -cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated Names names = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } - diff --git a/proto/canine-chain/rns/tx.proto b/proto/canine-chain/rns/tx.proto index cea8e3407..b82ff08fe 100644 --- a/proto/canine-chain/rns/tx.proto +++ b/proto/canine-chain/rns/tx.proto @@ -1,7 +1,6 @@ syntax = "proto3"; package jackaldao.canine.rns; - option go_package = "github.com/jackal-dao/canine/x/rns/types"; // Msg defines the Msg service. @@ -19,7 +18,6 @@ service Msg { rpc Init(MsgInit) returns (MsgInitResponse); } - message MsgRegister { string creator = 1; string name = 2; @@ -27,8 +25,7 @@ message MsgRegister { string data = 4; } -message MsgRegisterResponse { -} +message MsgRegisterResponse {} message MsgBid { string creator = 1; @@ -36,8 +33,7 @@ message MsgBid { string bid = 3; } -message MsgBidResponse { -} +message MsgBidResponse {} message MsgAcceptBid { string creator = 1; @@ -45,16 +41,14 @@ message MsgAcceptBid { string from = 3; } -message MsgAcceptBidResponse { -} +message MsgAcceptBidResponse {} message MsgCancelBid { string creator = 1; string name = 2; } -message MsgCancelBidResponse { -} +message MsgCancelBidResponse {} message MsgList { string creator = 1; @@ -62,25 +56,21 @@ message MsgList { string price = 3; } -message MsgListResponse { -} +message MsgListResponse {} message MsgBuy { string creator = 1; string name = 2; } -message MsgBuyResponse { -} +message MsgBuyResponse {} message MsgDelist { string creator = 1; string name = 2; } -message MsgDelistResponse { -} - +message MsgDelistResponse {} message MsgTransfer { string creator = 1; @@ -88,8 +78,7 @@ message MsgTransfer { string receiver = 3; } -message MsgTransferResponse { -} +message MsgTransferResponse {} message MsgAddRecord { string creator = 1; @@ -99,20 +88,15 @@ message MsgAddRecord { string record = 5; } -message MsgAddRecordResponse { -} +message MsgAddRecordResponse {} message MsgDelRecord { string creator = 1; string name = 2; } -message MsgDelRecordResponse { -} +message MsgDelRecordResponse {} -message MsgInit { - string creator = 1; -} +message MsgInit { string creator = 1; } -message MsgInitResponse { -} +message MsgInitResponse {} diff --git a/proto/canine-chain/rns/whois.proto b/proto/canine-chain/rns/whois.proto index 294a8dd2b..f9b47c487 100644 --- a/proto/canine-chain/rns/whois.proto +++ b/proto/canine-chain/rns/whois.proto @@ -4,10 +4,8 @@ package jackaldao.canine.rns; option go_package = "github.com/jackal-dao/canine/x/rns/types"; message Whois { - string index = 1; - string name = 2; - string value = 3; - string data = 4; - + string index = 1; + string name = 2; + string value = 3; + string data = 4; } - diff --git a/proto/canine-chain/storage/active_deals.proto b/proto/canine-chain/storage/active_deals.proto new file mode 100644 index 000000000..2c69fb576 --- /dev/null +++ b/proto/canine-chain/storage/active_deals.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package jackaldao.canine.storage; + +option go_package = "github.com/jackal-dao/canine/x/storage/types"; + +message ActiveDeals { + string cid = 1; + string signee = 2; + string provider = 3; + string startblock = 4; + string endblock = 5; + string filesize = 6; + string proofverified = 7; + string proofsmissed = 8; + string blocktoprove = 9; + string creator = 10; + string merkle = 11; + string fid = 12; +} diff --git a/proto/canine-chain/storage/client_usage.proto b/proto/canine-chain/storage/client_usage.proto new file mode 100644 index 000000000..6bd6c90fa --- /dev/null +++ b/proto/canine-chain/storage/client_usage.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package jackaldao.canine.storage; + +option go_package = "github.com/jackal-dao/canine/x/storage/types"; + +message ClientUsage { + string address = 1; + string usage = 2; +} diff --git a/proto/canine-chain/storage/contracts.proto b/proto/canine-chain/storage/contracts.proto new file mode 100644 index 000000000..399a127ce --- /dev/null +++ b/proto/canine-chain/storage/contracts.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package jackaldao.canine.storage; + +option go_package = "github.com/jackal-dao/canine/x/storage/types"; + +message Contracts { + string cid = 1; + string priceamt = 2; + string pricedenom = 3; + string merkle = 5; + string signee = 6; + string duration = 7; + string filesize = 8; + string fid = 9; + string creator = 4; +} diff --git a/proto/canine-chain/storage/fid_cid.proto b/proto/canine-chain/storage/fid_cid.proto new file mode 100644 index 000000000..05f222059 --- /dev/null +++ b/proto/canine-chain/storage/fid_cid.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package jackaldao.canine.storage; + +option go_package = "github.com/jackal-dao/canine/x/storage/types"; + +message FidCid { + string fid = 1; + string cids = 2; +} diff --git a/proto/canine-chain/storage/genesis.proto b/proto/canine-chain/storage/genesis.proto new file mode 100644 index 000000000..9c718d489 --- /dev/null +++ b/proto/canine-chain/storage/genesis.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package jackaldao.canine.storage; + +import "gogoproto/gogo.proto"; +import "canine-chain/storage/params.proto"; +import "canine-chain/storage/contracts.proto"; +import "canine-chain/storage/active_deals.proto"; +import "canine-chain/storage/providers.proto"; +import "canine-chain/storage/pay_blocks.proto"; +import "canine-chain/storage/client_usage.proto"; +import "canine-chain/storage/strays.proto"; +import "canine-chain/storage/fid_cid.proto"; +// this line is used by starport scaffolding # genesis/proto/import + +option go_package = "github.com/jackal-dao/canine/x/storage/types"; + +// GenesisState defines the storage module's genesis state. +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; + repeated Contracts contractsList = 2 [ (gogoproto.nullable) = false ]; + repeated ActiveDeals activeDealsList = 4 [ (gogoproto.nullable) = false ]; + repeated Providers providersList = 5 [ (gogoproto.nullable) = false ]; + repeated PayBlocks payBlocksList = 6 [ (gogoproto.nullable) = false ]; + repeated ClientUsage clientUsageList = 7 [ (gogoproto.nullable) = false ]; + repeated Strays straysList = 8 [ (gogoproto.nullable) = false ]; + repeated FidCid fidCidList = 3 [ (gogoproto.nullable) = false ]; + // this line is used by starport scaffolding # genesis/proto/state +} diff --git a/proto/canine-chain/storage/params.proto b/proto/canine-chain/storage/params.proto new file mode 100644 index 000000000..bd929d393 --- /dev/null +++ b/proto/canine-chain/storage/params.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package jackaldao.canine.storage; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/jackal-dao/canine/x/storage/types"; + +// Params defines the parameters for the module. +message Params { option (gogoproto.goproto_stringer) = false; } \ No newline at end of file diff --git a/proto/canine-chain/storage/pay_blocks.proto b/proto/canine-chain/storage/pay_blocks.proto new file mode 100644 index 000000000..60b24d1c2 --- /dev/null +++ b/proto/canine-chain/storage/pay_blocks.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package jackaldao.canine.storage; + +option go_package = "github.com/jackal-dao/canine/x/storage/types"; + +message PayBlocks { + string blockid = 1; + string bytes = 2; + string blocktype = 3; + string blocknum = 4; +} diff --git a/proto/canine-chain/storage/providers.proto b/proto/canine-chain/storage/providers.proto new file mode 100644 index 000000000..dbe518024 --- /dev/null +++ b/proto/canine-chain/storage/providers.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package jackaldao.canine.storage; + +option go_package = "github.com/jackal-dao/canine/x/storage/types"; + +message Providers { + string address = 1; + string ip = 2; + string totalspace = 3; + string burned_contracts = 4; + string creator = 5; +} diff --git a/proto/canine-chain/storage/query.proto b/proto/canine-chain/storage/query.proto new file mode 100644 index 000000000..4eb09b9f2 --- /dev/null +++ b/proto/canine-chain/storage/query.proto @@ -0,0 +1,266 @@ +syntax = "proto3"; +package jackaldao.canine.storage; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "canine-chain/storage/params.proto"; +import "canine-chain/storage/contracts.proto"; +import "canine-chain/storage/active_deals.proto"; +import "canine-chain/storage/providers.proto"; +import "canine-chain/storage/pay_blocks.proto"; +import "canine-chain/storage/client_usage.proto"; +import "canine-chain/storage/strays.proto"; +import "canine-chain/storage/fid_cid.proto"; +// this line is used by starport scaffolding # 1 + +option go_package = "github.com/jackal-dao/canine/x/storage/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/jackal-dao/canine/storage/params"; + } + // Queries a Contracts by index. + rpc Contracts(QueryGetContractsRequest) returns (QueryGetContractsResponse) { + option (google.api.http).get = "/jackal-dao/canine/storage/contracts/{cid}"; + } + + // Queries a list of Contracts items. + rpc ContractsAll(QueryAllContractsRequest) + returns (QueryAllContractsResponse) { + option (google.api.http).get = "/jackal-dao/canine/storage/contracts"; + } + + // Queries a ActiveDeals by index. + rpc ActiveDeals(QueryGetActiveDealsRequest) + returns (QueryGetActiveDealsResponse) { + option (google.api.http).get = + "/jackal-dao/canine/storage/active_deals/{cid}"; + } + + // Queries a list of ActiveDeals items. + rpc ActiveDealsAll(QueryAllActiveDealsRequest) + returns (QueryAllActiveDealsResponse) { + option (google.api.http).get = "/jackal-dao/canine/storage/active_deals"; + } + + // Queries a Providers by index. + rpc Providers(QueryGetProvidersRequest) returns (QueryGetProvidersResponse) { + option (google.api.http).get = + "/jackal-dao/canine/storage/providers/{address}"; + } + + // Queries a list of Providers items. + rpc ProvidersAll(QueryAllProvidersRequest) + returns (QueryAllProvidersResponse) { + option (google.api.http).get = "/jackal-dao/canine/storage/providers"; + } + + // Queries a list of Freespace items. + rpc Freespace(QueryFreespaceRequest) returns (QueryFreespaceResponse) { + option (google.api.http).get = + "/jackal-dao/canine/storage/freespace/{address}"; + } + + // Queries a list of FindFile items. + rpc FindFile(QueryFindFileRequest) returns (QueryFindFileResponse) { + option (google.api.http).get = "/jackal-dao/canine/storage/find_file/{fid}"; + } + + // Queries a PayBlocks by index. + rpc PayBlocks(QueryGetPayBlocksRequest) returns (QueryGetPayBlocksResponse) { + option (google.api.http).get = + "/jackal-dao/canine/storage/pay_blocks/{blockid}"; + } + + // Queries a list of PayBlocks items. + rpc PayBlocksAll(QueryAllPayBlocksRequest) + returns (QueryAllPayBlocksResponse) { + option (google.api.http).get = "/jackal-dao/canine/storage/pay_blocks"; + } + + // Queries a ClientUsage by index. + rpc ClientUsage(QueryGetClientUsageRequest) + returns (QueryGetClientUsageResponse) { + option (google.api.http).get = + "/jackal-dao/canine/storage/client_usage/{address}"; + } + + // Queries a list of ClientUsage items. + rpc ClientUsageAll(QueryAllClientUsageRequest) + returns (QueryAllClientUsageResponse) { + option (google.api.http).get = "/jackal-dao/canine/storage/client_usage"; + } + + // Queries a Strays by index. + rpc Strays(QueryGetStraysRequest) returns (QueryGetStraysResponse) { + option (google.api.http).get = "/jackal-dao/canine/storage/strays/{cid}"; + } + + // Queries a list of Strays items. + rpc StraysAll(QueryAllStraysRequest) returns (QueryAllStraysResponse) { + option (google.api.http).get = "/jackal-dao/canine/storage/strays"; + } + + // Queries a list of GetClientFreeSpace items. + rpc GetClientFreeSpace(QueryGetClientFreeSpaceRequest) + returns (QueryGetClientFreeSpaceResponse) { + option (google.api.http).get = + "/jackal-dao/canine/storage/get_client_free_space/{address}"; + } + + // Queries a FidCid by index. + rpc FidCid(QueryGetFidCidRequest) returns (QueryGetFidCidResponse) { + option (google.api.http).get = "/jackal-dao/canine/storage/fid_cid/{fid}"; + } + + // Queries a list of FidCid items. + rpc FidCidAll(QueryAllFidCidRequest) returns (QueryAllFidCidResponse) { + option (google.api.http).get = "/jackal-dao/canine/storage/fid_cid"; + } + + // Queries a list of GetPayData items. + rpc GetPayData(QueryGetPayDataRequest) returns (QueryGetPayDataResponse) { + option (google.api.http).get = + "/jackal-dao/canine/storage/get_pay_data/{address}"; + } + + // this line is used by starport scaffolding # 2 +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryGetContractsRequest { string cid = 1; } + +message QueryGetContractsResponse { + Contracts contracts = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllContractsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllContractsResponse { + repeated Contracts contracts = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetActiveDealsRequest { string cid = 1; } + +message QueryGetActiveDealsResponse { + ActiveDeals activeDeals = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllActiveDealsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllActiveDealsResponse { + repeated ActiveDeals activeDeals = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetProvidersRequest { string address = 1; } + +message QueryGetProvidersResponse { + Providers providers = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllProvidersRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllProvidersResponse { + repeated Providers providers = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryFreespaceRequest { string address = 1; } + +message QueryFreespaceResponse { string space = 1; } + +message QueryFindFileRequest { string fid = 1; } + +message QueryFindFileResponse { string providerIps = 1; } + +message QueryGetPayBlocksRequest { string blockid = 1; } + +message QueryGetPayBlocksResponse { + PayBlocks payBlocks = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllPayBlocksRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllPayBlocksResponse { + repeated PayBlocks payBlocks = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetClientUsageRequest { string address = 1; } + +message QueryGetClientUsageResponse { + ClientUsage clientUsage = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllClientUsageRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllClientUsageResponse { + repeated ClientUsage clientUsage = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetStraysRequest { string cid = 1; } + +message QueryGetStraysResponse { + Strays strays = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllStraysRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllStraysResponse { + repeated Strays strays = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetClientFreeSpaceRequest { string address = 1; } + +message QueryGetClientFreeSpaceResponse { string bytesfree = 1; } + +message QueryGetFidCidRequest { string fid = 1; } + +message QueryGetFidCidResponse { + FidCid fidCid = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllFidCidRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllFidCidResponse { + repeated FidCid fidCid = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetPayDataRequest { string address = 1; } + +message QueryGetPayDataResponse { + int64 blocks_remaining = 1; + int64 bytes = 2; +} + +// this line is used by starport scaffolding # 3 diff --git a/proto/canine-chain/storage/strays.proto b/proto/canine-chain/storage/strays.proto new file mode 100644 index 000000000..236fd281a --- /dev/null +++ b/proto/canine-chain/storage/strays.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package jackaldao.canine.storage; + +option go_package = "github.com/jackal-dao/canine/x/storage/types"; + +message Strays { + string cid = 1; + string fid = 2; + string signee = 3; + string filesize = 4; + string merkle = 5; +} diff --git a/proto/canine-chain/storage/tx.proto b/proto/canine-chain/storage/tx.proto new file mode 100644 index 000000000..d20927f2d --- /dev/null +++ b/proto/canine-chain/storage/tx.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; +package jackaldao.canine.storage; + +option go_package = "github.com/jackal-dao/canine/x/storage/types"; + +// Msg defines the Msg service. +service Msg { + rpc PostContract(MsgPostContract) returns (MsgPostContractResponse); + rpc Postproof(MsgPostproof) returns (MsgPostproofResponse); + rpc SignContract(MsgSignContract) returns (MsgSignContractResponse); + rpc SetProviderIP(MsgSetProviderIP) returns (MsgSetProviderIPResponse); + rpc SetProviderTotalspace(MsgSetProviderTotalspace) + returns (MsgSetProviderTotalspaceResponse); + rpc InitProvider(MsgInitProvider) returns (MsgInitProviderResponse); + rpc CancelContract(MsgCancelContract) returns (MsgCancelContractResponse); + rpc BuyStorage(MsgBuyStorage) returns (MsgBuyStorageResponse); + rpc ClaimStray(MsgClaimStray) returns (MsgClaimStrayResponse); + // this line is used by starport scaffolding # proto/tx/rpc +} + +message MsgPostContract { + string creator = 1; + string merkle = 2; + string signee = 3; + string filesize = 4; + string fid = 5; +} + +message MsgPostContractResponse {} + +message MsgPostproof { + string creator = 1; + string item = 2; + string hashlist = 3; + string cid = 4; +} + +message MsgPostproofResponse { string merkle = 1; } + +message MsgSignContract { + string creator = 1; + string cid = 2; +} + +message MsgSignContractResponse {} + +message MsgSetProviderIP { + string creator = 1; + string ip = 2; +} + +message MsgSetProviderIPResponse {} + +message MsgSetProviderTotalspace { + string creator = 1; + string space = 2; +} + +message MsgSetProviderTotalspaceResponse {} + +message MsgInitProvider { + string creator = 1; + string ip = 2; + string totalspace = 3; +} + +message MsgInitProviderResponse {} + +message MsgCancelContract { + string creator = 1; + string cid = 2; +} + +message MsgCancelContractResponse {} + +message MsgBuyStorage { + string creator = 1; + string forAddress = 2; + string duration = 3; + string bytes = 4; + string paymentDenom = 5; +} + +message MsgBuyStorageResponse {} + +message MsgClaimStray { + string creator = 1; + string cid = 2; +} + +message MsgClaimStrayResponse {} + +// this line is used by starport scaffolding # proto/tx/message \ No newline at end of file diff --git a/scripts/mockgen.sh b/scripts/mockgen.sh index c322363e1..975e02253 100755 --- a/scripts/mockgen.sh +++ b/scripts/mockgen.sh @@ -1,3 +1,4 @@ mockgen_cmd="mockgen" $mockgen_cmd -source=x/rns/types/expected_keepers.go -package testutil -destination x/rns/testutil/expected_keepers_mocks.go +$mockgen_cmd -source=x/storage/types/expected_keepers.go -package testutil -destination x/storage/testutil/expected_keepers_mocks.go diff --git a/scripts/protoc-swagger-gen.sh b/scripts/protoc-swagger-gen.sh index f0a6bc8d9..8ab2cda6f 100644 --- a/scripts/protoc-swagger-gen.sh +++ b/scripts/protoc-swagger-gen.sh @@ -11,7 +11,6 @@ for dir in $proto_dirs; do if [[ ! -z "$query_file" ]]; then buf protoc \ -I "proto" \ - -I "third_party/proto" \ "$query_file" \ --swagger_out=./docs/client \ --swagger_opt=logtostderr=true --swagger_opt=fqn_for_swagger_name=true --swagger_opt=simple_operation_ids=true diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 619c4d313..2ac81b78c 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -2,10 +2,10 @@ set -euox pipefail # Get protoc executions -go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos 2>/dev/null +# go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos 2>/dev/null # Get cosmos sdk from github -go get github.com/cosmos/cosmos-sdk@v0.45.10 2>/dev/null +# go get github.com/cosmos/cosmos-sdk@v0.45.10 2>/dev/null echo "Generating gogo proto code" cd proto diff --git a/scripts/test-node.sh b/scripts/test-node.sh new file mode 100755 index 000000000..a133b04ca --- /dev/null +++ b/scripts/test-node.sh @@ -0,0 +1,43 @@ +export JKL_HOME="$HOME/canine-test" + +rm -rf $JKL_HOME +export CHAIN="canine-1" +export ALIAS="marston" +export MONIKER="jackal" + + +canined init $MONIKER --home=$JKL_HOME --chain-id=$CHAIN +canined config chain-id $CHAIN --home=$JKL_HOME +canined config keyring-backend test --home=$JKL_HOME + +sed -i.bak -e 's/chain-id = ""/chain-id = "canine-1"/' $JKL_HOME/config/client.toml + +echo "video pluck level diagram maximum grant make there clog tray enrich book hawk confirm spot you book vendor ensure theory sure jewel sort basket" | canined keys add $ALIAS --keyring-backend=test --recover --home=$JKL_HOME +echo "flock stereo dignity lawsuit mouse page faith exact mountain clinic hazard parent arrest face couch asset jump feed benefit upper hair scrap loud spirit" | canined keys add charlie --keyring-backend=test --recover --home=$JKL_HOME +echo "brief enhance flee chest rabbit matter chaos clever lady enable luggage arrange hint quarter change float embark canoe chalk husband legal dignity music web" | canined keys add danny --keyring-backend=test --recover --home=$JKL_HOME + +canined add-genesis-account $(canined keys show -a $ALIAS --keyring-backend=test --home=$JKL_HOME) 500000000ujkl --home=$JKL_HOME +canined add-genesis-account $(canined keys show -a charlie --keyring-backend=test --home=$JKL_HOME) 500000000ujkl --home=$JKL_HOME +canined add-genesis-account $(canined keys show -a danny --keyring-backend=test --home=$JKL_HOME) 500000000ujkl --home=$JKL_HOME + +canined gentx $ALIAS 200000000ujkl \ +--chain-id=$CHAIN \ +--moniker="$MONIKER" \ +--commission-max-change-rate=0.01 \ +--commission-max-rate=0.20 \ +--commission-rate=0.05 \ +--fees=2500ujkl \ +--from=$ALIAS \ +--keyring-backend=test \ +--home=$JKL_HOME + +canined collect-gentxs --home=$JKL_HOME + +sed -i.bak -e "s/stake/ujkl/" $JKL_HOME/config/genesis.json +sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025ujkl\"/" $JKL_HOME/config/app.toml +sed -i.bak -e 's/enable = false/enable=true/' $JKL_HOME/config/app.toml +sed -i.bak -e 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/' $JKL_HOME/config/app.toml +sed -i.bak -e 's/cors_allowed_origins = \[\]/cors_allowed_origins = \["*"\]/' $JKL_HOME/config/config.toml +# sed -i.bak -e 's/chain-id = ""/chain-id = "canine-1"/' $JKL_HOME/.canine/config/client.toml + +canined start --home=$JKL_HOME --log_level info \ No newline at end of file diff --git a/test_node.sh b/test_node.sh old mode 100644 new mode 100755 diff --git a/x/jklmint/keeper/keeper.go b/x/jklmint/keeper/keeper.go index c5b3e5ccd..fa543f8bb 100644 --- a/x/jklmint/keeper/keeper.go +++ b/x/jklmint/keeper/keeper.go @@ -85,35 +85,24 @@ func FloatToBigInt(val float64) *big.Int { } func (k Keeper) GetInflation(ctx sdk.Context) (sdk.Dec, error) { - coins := k.bankKeeper.GetSupply(ctx, k.GetParams(ctx).MintDenom) - zeroDec, err := sdk.NewDecFromStr("0") - if err != nil { - return zeroDec, types.ErrCannotParseFloat - } + denom := k.GetParams(ctx).MintDenom + coins := k.bankKeeper.GetSupply(ctx, denom) amt := coins.Amount.ToDec() - famt, err := amt.Float64() - if err != nil { - return zeroDec, types.ErrCannotParseFloat - } - var tokens float64 = 4 // TODO: Update to 10 when storage goes live - highDec, err := sdk.NewDecFromStr("1.0") - if err != nil { - return zeroDec, types.ErrCannotParseFloat + if amt.IsZero() { + return sdk.NewDec(0), nil } - if famt <= 0 { - return highDec, nil - } + var blocksPerYearEstiamte int64 = (365 * 24 * 60 * 60) / 6 - ratio := tokens / famt + printedPerYear := blocksPerYearEstiamte * 4_000_000 - ratioDec := FloatToBigInt(ratio) + inflate := sdk.NewDec(printedPerYear) - ratioSDK := sdk.NewDecFromBigInt(ratioDec) + quo := inflate.Quo(amt) - return ratioSDK, nil + return quo, nil } // AddCollectedFees implements an alias call to the underlying supply keeper's diff --git a/x/jklmint/types/query.pb.go b/x/jklmint/types/query.pb.go index b85ea185e..df0784126 100644 --- a/x/jklmint/types/query.pb.go +++ b/x/jklmint/types/query.pb.go @@ -201,33 +201,33 @@ func init() { func init() { proto.RegisterFile("canine-chain/jklmint/query.proto", fileDescriptor_09efc1ea2d24ed17) } var fileDescriptor_09efc1ea2d24ed17 = []byte{ - // 413 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xc1, 0xae, 0xd2, 0x40, - 0x14, 0x6d, 0x89, 0x92, 0x30, 0xba, 0x1a, 0x51, 0x49, 0xd5, 0x52, 0x6b, 0x42, 0x8c, 0xa1, 0x33, - 0x82, 0x7b, 0x17, 0xc4, 0x98, 0x98, 0xb8, 0x50, 0x12, 0x37, 0xee, 0xa6, 0x65, 0x28, 0x03, 0xed, - 0x4c, 0x61, 0x06, 0x23, 0x5b, 0x97, 0xae, 0x4c, 0x4c, 0xfc, 0x0b, 0xff, 0x83, 0x25, 0x89, 0x1b, - 0xe3, 0x82, 0x18, 0xf0, 0x43, 0x0c, 0x33, 0x03, 0xbc, 0xc7, 0x83, 0x3c, 0x56, 0x6d, 0xee, 0x9c, - 0x7b, 0xce, 0xb9, 0xe7, 0x5e, 0x10, 0x24, 0x84, 0x33, 0x4e, 0xa3, 0x64, 0x40, 0x18, 0xc7, 0xc3, - 0x51, 0x96, 0x33, 0xae, 0xf0, 0x78, 0x4a, 0x27, 0x33, 0x54, 0x4c, 0x84, 0x12, 0xb0, 0x36, 0x24, - 0xc9, 0x88, 0x64, 0x3d, 0x22, 0x90, 0xc1, 0x22, 0x8b, 0xf2, 0xaa, 0xa9, 0x48, 0x85, 0x06, 0xe1, - 0xcd, 0x9f, 0xc1, 0x7b, 0x0f, 0x53, 0x21, 0xd2, 0x8c, 0x62, 0x52, 0x30, 0x4c, 0x38, 0x17, 0x8a, - 0x28, 0x26, 0xb8, 0xb4, 0xaf, 0xcf, 0x12, 0x21, 0x73, 0x21, 0x71, 0x4c, 0x24, 0x35, 0x32, 0xf8, - 0x53, 0x2b, 0xa6, 0x8a, 0xb4, 0x70, 0x41, 0x52, 0xc6, 0x35, 0xd8, 0x62, 0x1f, 0x1f, 0xf5, 0x56, - 0x90, 0x09, 0xc9, 0x2d, 0x5d, 0x58, 0x05, 0xf0, 0xfd, 0x86, 0xe4, 0x9d, 0x2e, 0x76, 0xe9, 0x78, - 0x4a, 0xa5, 0x0a, 0x3f, 0x80, 0x3b, 0x97, 0xaa, 0xb2, 0x10, 0x5c, 0x52, 0xf8, 0x12, 0x94, 0x4d, - 0x73, 0xcd, 0x0d, 0xdc, 0xa7, 0xb7, 0xda, 0x01, 0x3a, 0x35, 0x1a, 0x32, 0x9d, 0x9d, 0x1b, 0xf3, - 0x65, 0xdd, 0xe9, 0xda, 0xae, 0xf0, 0x3e, 0xb8, 0xab, 0x69, 0xdf, 0xf0, 0x7e, 0xa6, 0x7d, 0x6e, - 0xf5, 0xfa, 0xe0, 0xde, 0xe1, 0x83, 0x95, 0x7c, 0x0b, 0x2a, 0x6c, 0x5b, 0xd4, 0xaa, 0xb7, 0x3b, - 0x68, 0xc3, 0xf9, 0x67, 0x59, 0x6f, 0xa4, 0x4c, 0x0d, 0xa6, 0x31, 0x4a, 0x44, 0x8e, 0x6d, 0x28, - 0xe6, 0x13, 0xc9, 0xde, 0x08, 0xab, 0x59, 0x41, 0x25, 0x7a, 0x45, 0x93, 0xee, 0x9e, 0xa0, 0xfd, - 0xb3, 0x04, 0x6e, 0x6a, 0x21, 0xf8, 0xd5, 0x05, 0x65, 0xe3, 0x11, 0x36, 0x4f, 0x4f, 0x71, 0x35, - 0x1a, 0x2f, 0x3a, 0x13, 0x6d, 0xfc, 0x87, 0x4f, 0xbe, 0xfc, 0xfa, 0xf7, 0xbd, 0xf4, 0x08, 0x3e, - 0xd8, 0x5a, 0xd4, 0x2b, 0xd8, 0x6f, 0x4c, 0x3b, 0xf8, 0xe1, 0x82, 0xca, 0x6e, 0x74, 0x88, 0xaf, - 0x51, 0x38, 0x4c, 0xcf, 0x7b, 0x7e, 0x7e, 0x83, 0x75, 0xd5, 0xd0, 0xae, 0x02, 0xe8, 0x1f, 0x75, - 0xb5, 0xcb, 0xab, 0xf3, 0x7a, 0xbe, 0xf2, 0xdd, 0xc5, 0xca, 0x77, 0xff, 0xae, 0x7c, 0xf7, 0xdb, - 0xda, 0x77, 0x16, 0x6b, 0xdf, 0xf9, 0xbd, 0xf6, 0x9d, 0x8f, 0xcd, 0x0b, 0xe1, 0x1b, 0xf5, 0xa8, - 0x47, 0x04, 0x36, 0xf2, 0xf8, 0xf3, 0xee, 0xd8, 0xf4, 0x1a, 0xe2, 0xb2, 0x3e, 0xb6, 0x17, 0xff, - 0x03, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x7b, 0x2c, 0x81, 0x2d, 0x03, 0x00, 0x00, + // 407 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x4f, 0xcf, 0xd2, 0x30, + 0x18, 0xdf, 0x88, 0x92, 0x50, 0x3d, 0x55, 0x54, 0xb2, 0x98, 0x01, 0xd3, 0x10, 0x35, 0xac, 0x15, + 0xbc, 0x7b, 0x20, 0xc6, 0xc4, 0xc4, 0x83, 0x92, 0x78, 0xf1, 0xd6, 0x8d, 0x32, 0x0a, 0x5b, 0x3b, + 0x68, 0x31, 0x72, 0xf5, 0x13, 0x90, 0x78, 0xf5, 0x8b, 0xf8, 0x0d, 0x38, 0x92, 0x78, 0x31, 0x1e, + 0x88, 0x01, 0x3f, 0x88, 0xa1, 0x2d, 0xf8, 0xbe, 0xf0, 0xf2, 0xbe, 0x9c, 0xb6, 0x3c, 0xfd, 0xfd, + 0xeb, 0xef, 0x29, 0xa8, 0xc5, 0x84, 0x33, 0x4e, 0xc3, 0x78, 0x40, 0x18, 0xc7, 0xc3, 0x51, 0x9a, + 0x31, 0xae, 0xf0, 0x78, 0x4a, 0x27, 0x33, 0x94, 0x4f, 0x84, 0x12, 0xb0, 0x32, 0x24, 0xf1, 0x88, + 0xa4, 0x3d, 0x22, 0x90, 0xc1, 0x22, 0x8b, 0xf2, 0xca, 0x89, 0x48, 0x84, 0x06, 0xe1, 0xed, 0x9f, + 0xc1, 0x7b, 0x8f, 0x12, 0x21, 0x92, 0x94, 0x62, 0x92, 0x33, 0x4c, 0x38, 0x17, 0x8a, 0x28, 0x26, + 0xb8, 0xb4, 0xa7, 0xcf, 0x63, 0x21, 0x33, 0x21, 0x71, 0x44, 0x24, 0x35, 0x36, 0xf8, 0x73, 0x2b, + 0xa2, 0x8a, 0xb4, 0x70, 0x4e, 0x12, 0xc6, 0x35, 0xd8, 0x62, 0xeb, 0x57, 0x66, 0xcb, 0xc9, 0x84, + 0x64, 0x56, 0x2e, 0x28, 0x03, 0xf8, 0x61, 0x2b, 0xf2, 0x5e, 0x0f, 0xbb, 0x74, 0x3c, 0xa5, 0x52, + 0x05, 0x1f, 0xc1, 0xbd, 0x4b, 0x53, 0x99, 0x0b, 0x2e, 0x29, 0x7c, 0x05, 0x8a, 0x86, 0x5c, 0x71, + 0x6b, 0xee, 0xd3, 0x3b, 0xed, 0x1a, 0x3a, 0x75, 0x35, 0x64, 0x98, 0x9d, 0x5b, 0x8b, 0x55, 0xd5, + 0xe9, 0x5a, 0x56, 0xf0, 0x10, 0xdc, 0xd7, 0xb2, 0x6f, 0x79, 0x3f, 0xd5, 0x39, 0x77, 0x7e, 0x7d, + 0xf0, 0xe0, 0xf0, 0xc0, 0x5a, 0xbe, 0x03, 0x25, 0xb6, 0x1b, 0x6a, 0xd7, 0xbb, 0x1d, 0xb4, 0xd5, + 0xfc, 0xbd, 0xaa, 0x36, 0x12, 0xa6, 0x06, 0xd3, 0x08, 0xc5, 0x22, 0xc3, 0xb6, 0x14, 0xf3, 0x09, + 0x65, 0x6f, 0x84, 0xd5, 0x2c, 0xa7, 0x12, 0xbd, 0xa6, 0x71, 0xf7, 0xbf, 0x40, 0xfb, 0x47, 0x01, + 0xdc, 0xd6, 0x46, 0x70, 0xee, 0x82, 0xa2, 0xc9, 0x08, 0x9b, 0xa7, 0x6f, 0x71, 0x5c, 0x8d, 0x17, + 0x9e, 0x89, 0x36, 0xf9, 0x83, 0x67, 0x5f, 0x7f, 0xfe, 0xfd, 0x56, 0x78, 0x0c, 0xeb, 0xd8, 0xd0, + 0xc2, 0x1e, 0x11, 0xd8, 0xf0, 0x0e, 0x16, 0x02, 0xbf, 0xbb, 0xa0, 0xb4, 0x2f, 0x00, 0xe2, 0x1b, + 0x7c, 0x0e, 0x3b, 0xf4, 0x5e, 0x9c, 0x4f, 0xb0, 0xd9, 0x9a, 0x3a, 0x5b, 0x03, 0x3e, 0xb9, 0x26, + 0xdb, 0xbe, 0xbb, 0xce, 0x9b, 0xc5, 0xda, 0x77, 0x97, 0x6b, 0xdf, 0xfd, 0xb3, 0xf6, 0xdd, 0xf9, + 0xc6, 0x77, 0x96, 0x1b, 0xdf, 0xf9, 0xb5, 0xf1, 0x9d, 0x4f, 0xcd, 0x0b, 0x8b, 0x38, 0x56, 0xfa, + 0xb2, 0xd7, 0xd2, 0x2b, 0x89, 0x8a, 0xfa, 0xe1, 0xbd, 0xfc, 0x17, 0x00, 0x00, 0xff, 0xff, 0x46, + 0x61, 0x77, 0x15, 0x39, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/jklmint/types/query.pb.gw.go b/x/jklmint/types/query.pb.gw.go index 529b167cb..5fcb876d1 100644 --- a/x/jklmint/types/query.pb.gw.go +++ b/x/jklmint/types/query.pb.gw.go @@ -206,9 +206,9 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "mint", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "jklmint", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Inflation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "mint", "v1beta1", "inflation"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Inflation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "jklmint", "inflation"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/rns/types/query.pb.go b/x/rns/types/query.pb.go index d3f872a79..320221a51 100644 --- a/x/rns/types/query.pb.go +++ b/x/rns/types/query.pb.go @@ -1167,70 +1167,70 @@ func init() { func init() { proto.RegisterFile("canine-chain/rns/query.proto", fileDescriptor_5e7ff5f7b6268f1d) } var fileDescriptor_5e7ff5f7b6268f1d = []byte{ - // 1007 bytes of a gzipped FileDescriptorProto + // 996 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x97, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0x33, 0x89, 0x13, 0x97, 0xa9, 0xc4, 0x61, 0x30, 0x50, 0x6d, 0x1c, 0x17, 0x4d, 0x93, - 0x36, 0x71, 0x92, 0x5d, 0xd2, 0x56, 0x42, 0x20, 0x71, 0x48, 0x0e, 0x8d, 0x90, 0x2a, 0x48, 0x7d, - 0x01, 0x21, 0x41, 0x19, 0x7b, 0x07, 0x67, 0x61, 0xb3, 0xe3, 0x7a, 0x37, 0xb4, 0x55, 0x14, 0x0e, - 0xfc, 0x90, 0x40, 0x02, 0xa9, 0x12, 0x70, 0xe0, 0x84, 0xf8, 0x0b, 0xe0, 0xcf, 0xe8, 0xb1, 0x12, - 0x17, 0x4e, 0x08, 0x25, 0xfc, 0x21, 0x68, 0xde, 0xbc, 0xad, 0xf7, 0x97, 0xd7, 0x6b, 0xe4, 0x4a, - 0xdc, 0x36, 0x99, 0xf7, 0xe6, 0x7d, 0xde, 0xf7, 0xbd, 0x7d, 0x6f, 0x4d, 0x9b, 0x3d, 0x11, 0x78, - 0x81, 0xdc, 0xee, 0x1d, 0x0a, 0x2f, 0x70, 0x86, 0x41, 0xe8, 0xdc, 0x3b, 0x96, 0xc3, 0x87, 0xf6, - 0x60, 0xa8, 0x22, 0xc5, 0x1a, 0x9f, 0x88, 0xde, 0xa7, 0xc2, 0x77, 0x85, 0xb2, 0x8d, 0x9d, 0x3d, - 0x0c, 0x42, 0xab, 0xd1, 0x57, 0x7d, 0x05, 0x06, 0x8e, 0x7e, 0x32, 0xb6, 0x56, 0xb3, 0xaf, 0x54, - 0xdf, 0x97, 0x8e, 0x18, 0x78, 0x8e, 0x08, 0x02, 0x15, 0x89, 0xc8, 0x53, 0x41, 0x88, 0xa7, 0xed, - 0x9e, 0x0a, 0x8f, 0x54, 0xe8, 0x74, 0x45, 0x28, 0x4d, 0x08, 0xe7, 0xb3, 0x9d, 0xae, 0x8c, 0xc4, - 0x8e, 0x33, 0x10, 0x7d, 0x2f, 0x00, 0x63, 0xb4, 0x5d, 0xc9, 0x31, 0x0d, 0xc4, 0x50, 0x1c, 0xc5, - 0x57, 0xe5, 0x91, 0xef, 0x1f, 0x2a, 0x6f, 0xfc, 0x69, 0x20, 0x8e, 0x64, 0x7c, 0xba, 0x9c, 0x3b, - 0xed, 0x7a, 0x6e, 0x7c, 0xd8, 0xca, 0x1d, 0x7e, 0xac, 0x86, 0xa1, 0xf0, 0xe5, 0x58, 0x67, 0x2f, - 0xf0, 0x22, 0x73, 0xc8, 0x1b, 0x94, 0xdd, 0xd1, 0x69, 0x1d, 0x00, 0x6a, 0x47, 0xde, 0x3b, 0x96, - 0x61, 0xc4, 0xef, 0xd0, 0x17, 0x52, 0xff, 0x0d, 0x07, 0x2a, 0x08, 0x25, 0x7b, 0x83, 0x2e, 0x99, - 0x94, 0x2e, 0x91, 0x57, 0xc8, 0xfa, 0xc5, 0xeb, 0x4d, 0xbb, 0x48, 0x68, 0xdb, 0x78, 0xed, 0xd5, - 0x1e, 0xff, 0x75, 0x79, 0xae, 0x83, 0x1e, 0x7c, 0x8b, 0x36, 0xe0, 0xca, 0x7d, 0x19, 0xbd, 0xab, - 0xf3, 0xc6, 0x50, 0xac, 0x41, 0x17, 0xbd, 0xc0, 0x95, 0x0f, 0xe0, 0xca, 0xe7, 0x3a, 0xe6, 0x0f, - 0x7e, 0x40, 0x5f, 0xcc, 0x58, 0x23, 0xc2, 0x6b, 0x74, 0x11, 0x64, 0x43, 0x82, 0xe5, 0x62, 0x02, - 0xf0, 0x41, 0x00, 0x63, 0xcf, 0x3f, 0xc4, 0xf8, 0xbb, 0xbe, 0x9f, 0x8a, 0x7f, 0x8b, 0xd2, 0x51, - 0x25, 0xf1, 0xd6, 0xab, 0xb6, 0x29, 0xbb, 0xad, 0xcb, 0x6e, 0x9b, 0xce, 0xc2, 0xb2, 0xdb, 0x07, - 0xa2, 0x2f, 0xd1, 0xb7, 0x93, 0xf0, 0xe4, 0x3f, 0x13, 0x44, 0x1e, 0x05, 0xc8, 0x23, 0x2f, 0x4c, - 0x83, 0xcc, 0xf6, 0x53, 0x68, 0xf3, 0x80, 0x76, 0x6d, 0x22, 0x9a, 0x89, 0x9a, 0x62, 0x4b, 0x68, - 0xff, 0xb6, 0xee, 0xaa, 0xca, 0xda, 0xa3, 0xf5, 0x28, 0x11, 0x68, 0xca, 0x72, 0xed, 0xc1, 0x27, - 0x4e, 0x04, 0xec, 0x93, 0xda, 0xa7, 0xe2, 0x3f, 0x0b, 0xed, 0xc7, 0x22, 0x2f, 0x4c, 0x83, 0x3c, - 0x3b, 0xed, 0x37, 0xf1, 0x55, 0xda, 0x97, 0xd1, 0x9e, 0xe7, 0x4e, 0x90, 0xfe, 0xf6, 0xa8, 0x50, - 0xc6, 0x18, 0xd3, 0xb8, 0x49, 0x6b, 0xfa, 0x85, 0x47, 0x89, 0xac, 0xe2, 0x2c, 0xb4, 0x07, 0x26, - 0x01, 0xd6, 0xfc, 0x03, 0x0c, 0xbd, 0xeb, 0xfb, 0xc9, 0xd0, 0xb3, 0x52, 0xfd, 0x27, 0x32, 0x2a, - 0xeb, 0x18, 0xda, 0x85, 0xea, 0xb4, 0xb3, 0xec, 0xf6, 0x97, 0x62, 0x11, 0x6f, 0x99, 0x41, 0x18, - 0x67, 0xce, 0x68, 0x4d, 0x57, 0x17, 0x35, 0x87, 0x67, 0xfe, 0x1e, 0x7d, 0x39, 0x67, 0x8d, 0x79, - 0xbc, 0x49, 0xeb, 0x38, 0x49, 0x51, 0xa5, 0x95, 0xe2, 0x54, 0xd0, 0x0f, 0xb3, 0x89, 0x7d, 0xf8, - 0x47, 0xc8, 0xb1, 0xeb, 0xfb, 0x19, 0x8e, 0x59, 0x55, 0xe0, 0x57, 0x82, 0xf0, 0xc9, 0x10, 0x45, - 0xf0, 0x0b, 0xd3, 0xc2, 0xcf, 0xae, 0x1a, 0xce, 0xa8, 0xff, 0xdf, 0x0a, 0xbc, 0x28, 0x96, 0xe0, - 0x12, 0xad, 0x0b, 0xd7, 0x1d, 0xca, 0x30, 0xc4, 0x6a, 0xc4, 0x7f, 0xf2, 0xf6, 0xe8, 0x1d, 0x30, - 0x0e, 0x98, 0x10, 0xa3, 0x35, 0xbd, 0xb7, 0xc0, 0xfc, 0x42, 0x07, 0x9e, 0x93, 0x1d, 0x9e, 0xbc, - 0xfc, 0x59, 0x74, 0x78, 0x8a, 0xe5, 0xe6, 0x53, 0x96, 0x92, 0x0e, 0xd7, 0x1e, 0x71, 0x87, 0x6b, - 0xeb, 0xd9, 0x69, 0xfa, 0x39, 0xb5, 0x00, 0xeb, 0xb6, 0x17, 0x46, 0xef, 0xdc, 0x0f, 0xa4, 0x9b, - 0x9a, 0xaa, 0x63, 0xa5, 0xcd, 0xe8, 0x32, 0xff, 0x9f, 0x75, 0xf9, 0x85, 0xd0, 0xe5, 0x42, 0x80, - 0xff, 0xcb, 0xd4, 0xbd, 0xfe, 0xdb, 0x45, 0xba, 0x08, 0x84, 0xec, 0x4b, 0x42, 0x97, 0xcc, 0x07, - 0x09, 0x5b, 0x2f, 0xe6, 0xc8, 0x7f, 0xff, 0x58, 0x1b, 0x15, 0x2c, 0x4d, 0x54, 0xbe, 0xfa, 0xc5, - 0x1f, 0xff, 0xfc, 0x30, 0xdf, 0x62, 0x4d, 0xc7, 0xb8, 0x6c, 0xbb, 0x42, 0x39, 0xc6, 0x47, 0x7f, - 0x6b, 0x99, 0xaf, 0x1f, 0xf6, 0x3d, 0xa1, 0x8b, 0x90, 0x2f, 0x6b, 0x97, 0x5c, 0x9d, 0xd9, 0xcf, - 0xd6, 0x66, 0x25, 0x5b, 0x04, 0xd9, 0x04, 0x90, 0x35, 0x76, 0xa5, 0x18, 0x04, 0x04, 0x76, 0x4e, - 0x60, 0xcf, 0x9c, 0xb2, 0x6f, 0x08, 0xbd, 0x00, 0xee, 0xbb, 0xbe, 0x5f, 0x8a, 0x94, 0x59, 0xd9, - 0xa5, 0x48, 0xd9, 0xed, 0xcb, 0xaf, 0x00, 0xd2, 0x0a, 0x5b, 0x2e, 0x41, 0x62, 0xdf, 0x12, 0x5a, - 0xd3, 0xcb, 0x80, 0x6d, 0x94, 0x67, 0x9b, 0x58, 0x61, 0x56, 0xbb, 0x8a, 0x29, 0x42, 0xb4, 0x01, - 0x62, 0x95, 0xf1, 0x62, 0x08, 0xbd, 0x7b, 0x9e, 0xca, 0xf2, 0x15, 0xa1, 0x75, 0xed, 0xac, 0x55, - 0xd9, 0x28, 0xcf, 0xb4, 0x2a, 0x4e, 0x66, 0x39, 0x72, 0x0e, 0x38, 0x4d, 0x66, 0x8d, 0xc7, 0x61, - 0x3f, 0x12, 0x5a, 0xc7, 0xb9, 0xcc, 0xb6, 0xca, 0x53, 0x4d, 0x6f, 0x16, 0x6b, 0xbb, 0xa2, 0x35, - 0xc2, 0x6c, 0x01, 0xcc, 0x55, 0xb6, 0x5a, 0x0c, 0x83, 0xcb, 0xc0, 0x39, 0xd1, 0x95, 0x3a, 0x65, - 0x8f, 0x08, 0xa5, 0x78, 0x83, 0x16, 0x68, 0xab, 0x3c, 0xeb, 0x29, 0xc8, 0xf2, 0xeb, 0x8b, 0xaf, - 0x01, 0xd9, 0x65, 0xb6, 0x52, 0x4a, 0xc6, 0xbe, 0x23, 0xb4, 0xa6, 0xe7, 0xec, 0xa4, 0xe6, 0x49, - 0x6c, 0x87, 0x49, 0xcd, 0x93, 0x1c, 0xf4, 0x7c, 0x1b, 0x30, 0xae, 0xb1, 0xb5, 0x62, 0x0c, 0xf8, - 0x25, 0xe5, 0x9c, 0xe0, 0x7c, 0x3d, 0x65, 0x5f, 0x13, 0x5a, 0xd7, 0xfe, 0x15, 0xfa, 0xa7, 0x2a, - 0x51, 0x66, 0xf5, 0x4c, 0x7a, 0xa7, 0x80, 0x88, 0xfd, 0x4e, 0xe8, 0xf3, 0xe9, 0xd9, 0xcc, 0x5e, - 0x2d, 0x89, 0x51, 0xb8, 0x47, 0xac, 0x9d, 0x29, 0x3c, 0x10, 0xee, 0x75, 0x80, 0xbb, 0xc1, 0x76, - 0xc6, 0xc0, 0xf9, 0x5e, 0x18, 0xdd, 0x55, 0xda, 0xef, 0x2e, 0xce, 0xa3, 0x58, 0xba, 0xbd, 0xbd, - 0xc7, 0x67, 0x2d, 0xf2, 0xe4, 0xac, 0x45, 0xfe, 0x3e, 0x6b, 0x91, 0x47, 0xe7, 0xad, 0xb9, 0x27, - 0xe7, 0xad, 0xb9, 0x3f, 0xcf, 0x5b, 0x73, 0xef, 0xaf, 0xf7, 0xbd, 0xe8, 0xf0, 0xb8, 0x6b, 0xf7, - 0xd4, 0x51, 0xc1, 0xb5, 0x0f, 0xe0, 0xe2, 0xe8, 0xe1, 0x40, 0x86, 0xdd, 0x25, 0xf8, 0x4d, 0x7b, - 0xe3, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9b, 0xda, 0x9d, 0x8b, 0x1e, 0x10, 0x00, 0x00, + 0x14, 0xc7, 0x33, 0x89, 0x13, 0x97, 0xa9, 0xc4, 0x61, 0x30, 0x50, 0xad, 0xed, 0x6d, 0xb5, 0x6d, + 0xd2, 0xc4, 0xb1, 0x77, 0x71, 0x5b, 0x09, 0x81, 0xc4, 0xc1, 0x3e, 0x34, 0x42, 0xaa, 0x20, 0xf5, + 0x05, 0x84, 0x04, 0x65, 0xec, 0x1d, 0x9c, 0x85, 0xf5, 0x8e, 0xeb, 0xdd, 0xd0, 0x56, 0x51, 0x39, + 0x20, 0x38, 0x80, 0x10, 0x02, 0xa1, 0x1e, 0x38, 0x21, 0xfe, 0x03, 0x4e, 0xfc, 0x0d, 0x3d, 0x56, + 0xe2, 0xc2, 0x09, 0xa1, 0x84, 0x3f, 0x04, 0xcd, 0xcc, 0xdb, 0x7a, 0x7f, 0x7b, 0x8d, 0x1c, 0x89, + 0xdb, 0x3a, 0xf3, 0xde, 0xbc, 0xcf, 0xfb, 0xbe, 0xb7, 0xef, 0x6d, 0x70, 0x63, 0x44, 0x3d, 0xc7, + 0x63, 0x9d, 0xd1, 0x11, 0x75, 0x3c, 0x6b, 0xe6, 0xf9, 0xd6, 0xfd, 0x63, 0x36, 0x7b, 0x64, 0x4e, + 0x67, 0x3c, 0xe0, 0xa4, 0xf6, 0x29, 0x1d, 0x7d, 0x46, 0x5d, 0x9b, 0x72, 0x53, 0xd9, 0x99, 0x33, + 0xcf, 0xd7, 0x6a, 0x63, 0x3e, 0xe6, 0xd2, 0xc0, 0x12, 0x4f, 0xca, 0x56, 0x6b, 0x8c, 0x39, 0x1f, + 0xbb, 0xcc, 0xa2, 0x53, 0xc7, 0xa2, 0x9e, 0xc7, 0x03, 0x1a, 0x38, 0xdc, 0xf3, 0xe1, 0xb4, 0x35, + 0xe2, 0xfe, 0x84, 0xfb, 0xd6, 0x90, 0xfa, 0x4c, 0x85, 0xb0, 0x3e, 0xef, 0x0e, 0x59, 0x40, 0xbb, + 0xd6, 0x94, 0x8e, 0x1d, 0x4f, 0x1a, 0x83, 0x6d, 0x33, 0xc5, 0x34, 0xa5, 0x33, 0x3a, 0x09, 0xaf, + 0x4a, 0x23, 0x3f, 0x38, 0xe2, 0x4e, 0xfe, 0xa9, 0x47, 0x27, 0x2c, 0x3c, 0xad, 0xa7, 0x4e, 0x87, + 0x8e, 0x1d, 0x1e, 0xea, 0xa9, 0xc3, 0x4f, 0xf8, 0xcc, 0xa7, 0x2e, 0xcb, 0x75, 0x76, 0x3c, 0x27, + 0x50, 0x87, 0x46, 0x0d, 0x93, 0xbb, 0x22, 0xad, 0x43, 0x89, 0x3a, 0x60, 0xf7, 0x8f, 0x99, 0x1f, + 0x18, 0x77, 0xf1, 0x4b, 0xb1, 0xbf, 0xfa, 0x53, 0xee, 0xf9, 0x8c, 0xbc, 0x89, 0xb7, 0x54, 0x4a, + 0x97, 0xd0, 0x15, 0xb4, 0x7b, 0xf1, 0x46, 0xc3, 0xcc, 0x12, 0xda, 0x54, 0x5e, 0xfd, 0xca, 0xd3, + 0xbf, 0x2e, 0xaf, 0x0d, 0xc0, 0xc3, 0x68, 0xe3, 0x9a, 0xbc, 0xf2, 0x80, 0x05, 0xef, 0x89, 0xbc, + 0x21, 0x14, 0xa9, 0xe1, 0x4d, 0xc7, 0xb3, 0xd9, 0x43, 0x79, 0xe5, 0x0b, 0x03, 0xf5, 0xc3, 0x38, + 0xc4, 0x2f, 0x27, 0xac, 0x01, 0xe1, 0x75, 0xbc, 0x29, 0x65, 0x03, 0x82, 0x7a, 0x36, 0x81, 0xf4, + 0x01, 0x00, 0x65, 0x6f, 0x7c, 0x04, 0xf1, 0x7b, 0xae, 0x1b, 0x8b, 0x7f, 0x1b, 0xe3, 0x79, 0x25, + 0xe1, 0xd6, 0x1d, 0x53, 0x95, 0xdd, 0x14, 0x65, 0x37, 0x55, 0x67, 0x41, 0xd9, 0xcd, 0x43, 0x3a, + 0x66, 0xe0, 0x3b, 0x88, 0x78, 0x1a, 0x3f, 0x23, 0x40, 0x9e, 0x07, 0x48, 0x23, 0x6f, 0x2c, 0x83, + 0x4c, 0x0e, 0x62, 0x68, 0xeb, 0x12, 0xed, 0xfa, 0x42, 0x34, 0x15, 0x35, 0xc6, 0x16, 0xd1, 0xfe, + 0x1d, 0xd1, 0x55, 0xa5, 0xb5, 0x07, 0xeb, 0x79, 0x22, 0xb2, 0x29, 0x8b, 0xb5, 0x97, 0x3e, 0x61, + 0x22, 0xd2, 0x3e, 0xaa, 0x7d, 0x2c, 0xfe, 0x79, 0x68, 0x9f, 0x8b, 0xbc, 0xb1, 0x0c, 0xf2, 0xea, + 0xb4, 0xdf, 0x87, 0x57, 0xe9, 0x80, 0x05, 0x7d, 0xc7, 0x5e, 0x20, 0xfd, 0x9d, 0x79, 0xa1, 0x94, + 0x31, 0xa4, 0x71, 0x0b, 0x57, 0xc4, 0x0b, 0x0f, 0x12, 0x69, 0xd9, 0x59, 0x08, 0x0f, 0x48, 0x42, + 0x5a, 0x1b, 0x1f, 0x42, 0xe8, 0x9e, 0xeb, 0x46, 0x43, 0xaf, 0x4a, 0xf5, 0x27, 0x68, 0x5e, 0xd6, + 0x1c, 0xda, 0x8d, 0xf2, 0xb4, 0xab, 0xec, 0xf6, 0x57, 0x42, 0x11, 0x6f, 0xab, 0x41, 0x18, 0x66, + 0x4e, 0x70, 0x45, 0x54, 0x17, 0x34, 0x97, 0xcf, 0xc6, 0xfb, 0xf8, 0xd5, 0x94, 0x35, 0xe4, 0xf1, + 0x16, 0xae, 0xc2, 0x24, 0x05, 0x95, 0x9a, 0xd9, 0xa9, 0x80, 0x1f, 0x64, 0x13, 0xfa, 0x18, 0x1f, + 0x03, 0x47, 0xcf, 0x75, 0x13, 0x1c, 0xab, 0xaa, 0xc0, 0xaf, 0x08, 0xe0, 0xa3, 0x21, 0xb2, 0xe0, + 0x37, 0x96, 0x85, 0x5f, 0x5d, 0x35, 0xac, 0x79, 0xff, 0xbf, 0xed, 0x39, 0x41, 0x28, 0xc1, 0x25, + 0x5c, 0xa5, 0xb6, 0x3d, 0x63, 0xbe, 0x0f, 0xd5, 0x08, 0x7f, 0x1a, 0xad, 0xf9, 0x3b, 0xa0, 0x1c, + 0x20, 0x21, 0x82, 0x2b, 0x62, 0x6f, 0x49, 0xf3, 0x0b, 0x03, 0xf9, 0x1c, 0xed, 0xf0, 0xe8, 0xe5, + 0xe7, 0xd1, 0xe1, 0x31, 0x96, 0x5b, 0xcf, 0x59, 0x0a, 0x3a, 0x5c, 0x78, 0x84, 0x1d, 0x2e, 0xac, + 0x57, 0xa7, 0xe9, 0x17, 0x58, 0x93, 0x58, 0x77, 0x1c, 0x3f, 0x78, 0xf7, 0x81, 0xc7, 0xec, 0xd8, + 0x54, 0xcd, 0x95, 0x36, 0xa1, 0xcb, 0xfa, 0x7f, 0xd6, 0xe5, 0x17, 0x84, 0xeb, 0x99, 0x00, 0xff, + 0x97, 0xa9, 0x7b, 0xe3, 0xf7, 0x8b, 0x78, 0x53, 0x12, 0x92, 0xaf, 0x10, 0xde, 0x52, 0x1f, 0x24, + 0x64, 0x37, 0x9b, 0x23, 0xfd, 0xfd, 0xa3, 0xed, 0x95, 0xb0, 0x54, 0x51, 0x8d, 0xed, 0x2f, 0xff, + 0xf8, 0xe7, 0xa7, 0xf5, 0xcb, 0xa4, 0x69, 0x29, 0x97, 0x8e, 0x4d, 0xb9, 0xa5, 0x7c, 0x22, 0xdf, + 0x80, 0xe4, 0x7b, 0x84, 0x37, 0x65, 0xc2, 0xa4, 0x55, 0x70, 0x77, 0x62, 0x41, 0x6b, 0xfb, 0xa5, + 0x6c, 0x81, 0xa4, 0x2d, 0x49, 0x76, 0xc8, 0xb5, 0x1c, 0x12, 0x29, 0xb1, 0x75, 0x22, 0x37, 0xcd, + 0x63, 0xf2, 0x0d, 0xc2, 0x17, 0xa4, 0x7f, 0xcf, 0x75, 0x0b, 0x99, 0x12, 0x4b, 0xbb, 0x90, 0x29, + 0xb9, 0x7f, 0x8d, 0x6b, 0x92, 0x49, 0x27, 0x8d, 0x22, 0x26, 0xf2, 0x2d, 0xc2, 0x15, 0xb1, 0x0f, + 0xc8, 0x5e, 0x71, 0xbe, 0x91, 0x2d, 0xa6, 0xb5, 0xca, 0x98, 0x02, 0xc5, 0xbe, 0xa4, 0xd8, 0x26, + 0x57, 0x73, 0x28, 0xc4, 0xfe, 0x79, 0x2e, 0xcc, 0xd7, 0x08, 0x57, 0x85, 0xb7, 0xd0, 0x65, 0xaf, + 0x38, 0xd7, 0xb2, 0x3c, 0x89, 0x05, 0x69, 0x5c, 0x95, 0x3c, 0x4d, 0x52, 0x2f, 0xe0, 0x21, 0x4f, + 0x10, 0xae, 0xc2, 0x70, 0x26, 0xed, 0xe2, 0x64, 0xe3, 0xeb, 0x45, 0xeb, 0x94, 0xb4, 0x06, 0x9a, + 0x8e, 0xa4, 0xb9, 0x4e, 0xb6, 0x73, 0x68, 0x60, 0x25, 0x58, 0x27, 0xa2, 0x58, 0x8f, 0xc9, 0x8f, + 0x08, 0x63, 0xb8, 0x42, 0x48, 0xd4, 0x2e, 0xce, 0x7b, 0x09, 0xb4, 0xf4, 0x12, 0x33, 0x76, 0x24, + 0xda, 0x15, 0xa2, 0x17, 0xa3, 0x91, 0xef, 0x10, 0xae, 0x88, 0x71, 0xbb, 0xa8, 0x81, 0x22, 0x4b, + 0x62, 0x51, 0x03, 0x45, 0xe7, 0xfd, 0x42, 0x89, 0xc4, 0x78, 0xb7, 0x4e, 0x60, 0xcc, 0xaa, 0x16, + 0x12, 0xfe, 0x25, 0x5a, 0xa8, 0x2c, 0x51, 0x62, 0x03, 0x2d, 0x6c, 0x21, 0xb9, 0x70, 0x7e, 0x43, + 0xf8, 0xc5, 0xf8, 0x88, 0x26, 0xaf, 0x15, 0xc4, 0xc8, 0x5c, 0x27, 0x5a, 0x77, 0x09, 0x0f, 0x80, + 0x7b, 0x43, 0xc2, 0xdd, 0x24, 0xdd, 0x1c, 0x38, 0xd7, 0xf1, 0x83, 0x7b, 0x5c, 0xf8, 0xdd, 0x83, + 0xa1, 0x14, 0x4a, 0xd7, 0xef, 0x3f, 0x3d, 0xd5, 0xd1, 0xb3, 0x53, 0x1d, 0xfd, 0x7d, 0xaa, 0xa3, + 0x1f, 0xce, 0xf4, 0xb5, 0x67, 0x67, 0xfa, 0xda, 0x9f, 0x67, 0xfa, 0xda, 0x07, 0xbb, 0x63, 0x27, + 0x38, 0x3a, 0x1e, 0x9a, 0x23, 0x3e, 0xc9, 0xb8, 0xf6, 0xa1, 0xbc, 0x38, 0x78, 0x34, 0x65, 0xfe, + 0x70, 0x4b, 0xfe, 0x6b, 0x7b, 0xf3, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x35, 0x09, 0xa3, + 0x25, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/rns/types/query.pb.gw.go b/x/rns/types/query.pb.gw.go index f85589b95..3196fd3e8 100644 --- a/x/rns/types/query.pb.gw.go +++ b/x/rns/types/query.pb.gw.go @@ -964,19 +964,19 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"jackal-dao", "canine", "rnsparams"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "rns", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Names_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"jackal-dao", "canine", "rnsnames", "index"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Names_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "rns", "names", "index"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_NamesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"jackal-dao", "canine", "rnsnames"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_NamesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "rns", "names"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Bids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"jackal-dao", "canine", "rnsbids", "index"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Bids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "rns", "bids", "index"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_BidsAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"jackal-dao", "canine", "rnsbids"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_BidsAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "rns", "bids"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Forsale_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"jackal-dao", "canine", "rnsforsale", "name"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Forsale_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "rns", "forsale", "name"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ForsaleAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"jackal-dao", "canine", "rnsforsale"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ForsaleAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "rns", "forsale"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Init_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "rns", "init", "address"}, "", runtime.AssumeColonVerbOpt(false))) diff --git a/x/storage/README.md b/x/storage/README.md new file mode 100644 index 000000000..abadc0dff --- /dev/null +++ b/x/storage/README.md @@ -0,0 +1,173 @@ + +[◀ modules](/x/README.md) + +# `storage` + +## Contents +1. [Jackal Proof-of-Persistence (JPOP)](#jackal-proof-of-persistence-jpop) +2. [Interaction Outline](#interaction-outline) +2. [Client](#client) + + [Query](#query) + + [list-active-deals](#list-active-deals) + + [show-active-deals](#show-active-deals) + + [list-miners](#list-miners) + + [show-miners](#show-miners) + + [list-contracts](#list-contracts) + + [show-contracts](#show-contracts) + + [find-file](#find-file) + + [freespace](#freespace) + + [get-client-free-space](#get-client-free-space) + + [list-pay-blocks](#list-pay-blocks) + + [show-pay-blocks](#show-pay-blocks) + + [list-proofs](#list-proofs) + + [show-proofs](#show-proofs) + + [list-strays](#list-strays) + + [show-strays](#show-strays) + + [params](#params) + + [Transactions](#transactions) + + [init-miner](#init-miner) + + [set-miner-ip](#set-miner-ip) + + [set-miner-totalspace](#set-miner-totalspace) + + [sign-contract](#sign-contract) + + [post-contract](#post-contract) + + [postproof](#postproof) + + [buy-storage](#buy-storage) + + [cancel-contract](#cancel-contract) + + +## Jackal Proof-of-Persistence (JPOP) +Jackal Storage functions by a Proof-of-Storage algorithm we call Proof-of-Persistence. The Jackal Proof-of-Persistence (JPOP) works through a series of contracts formed between the storage provider and the user. These contracts contain the Merkle Tree root hash of the file and the information required to prove ownership of the file. Miners, or as well call them, Storage Providers, are responsible for posting Merkle Proofs within a challenge window determined by the blockchain. These challenge windows require the miner to post the raw data chunk of data corresponding to the index of the challenge window alongside the required Merkle Hashes to prove the data belongs to the Merkle Root stored on the contract. These challenge indexes are chosen at random by the blockchain using a block-hash-based random number generator paired with a random data oracle. + +### Internal Detection Of Loss (IDOL) Protocol +If a Storage Provider successfully posts a Merkle Proof within the challenge window for the contract and the data is verified by the Validators to be valid Merkle Proofs for the challenge index, the Storage Provider is paid out. Storage Provider rewards are proportional to the file size the contract is associated with relative to every other active contract on the network. If a Storage Provider fails to provide a valid proof within the allotted timeframe, the contract is struck with a missed proof. After X missed proofs the contract is burned and the User is alerted the next time they query the contract. For every contract burned through missing proofs, the Storage Provider is struck with a penalty that remains on their record for a period of time adjustable through governance. These contracts are then moved to a new list where they are able to be claimed by other providers. This system follows our secondary protocol IDOL (Internal Detection Of Loss), where a contract is claimed by a new provider and downloaded from one of the two online providers storing the same file, thus resuming that contract's proof action, returning redundancy to 3x. + +## Interaction Outline +A user first sends a file to an available Storage Provider. A list of Storage Providers can be found on the blockchain and miners can deny any incoming request if they wish not to store new files. The Storage Provider, after receiving the entire file, keeps that file in memory and posts a contract to the blockchain. If the contract is not signed by the sender in X blocks (configurable by the Storage Provider), then the file is removed from memory and the contract is burned. However, if the contract is signed by the user within the given blocks, the file is committed to the Storage Provider's hard storage and the challenge windows start being created for the now active contract. + +## Client +### Query +The `query` commands allow users to query `storage` state. +```sh +canined q storage --help +``` +#### list-active-deals +The `list-active-deals` command allows users to view a list of currently active contracts that have already been signed. +```sh +canined q storage list-active-deals +``` +#### show-active-deals +The `show-active-deals` command allows users to view information about a specific active deal by passing in the contract id. +```sh +canined q storage show-active-deals [cid] +``` +#### list-miners +The `list-miners` command allows users to view a list of currently registered mining nodes. +```sh +canined q storage list-miners +``` +#### show-miners +The `show-miners` command allows users to view information about a specific miner by passing in its jackal address. +```sh +canined q storage show-miners [address] +``` +#### list-contracts +The `list-contracts` command allows users to see a list of currently alive contracts that are awaiting signatures. +```sh +canined q storage list-contracts +``` +#### show-contracts +The `show-contracts` command allows users to view information about a specific contract as the identifier. +```sh +canined q storage show-contracts [cid] +``` +#### find-file +The `find-file` command lets a user enter a file id (fid) and return every storage provider currently storing that file. +```sh +canined q storage find-file [fid] +``` +#### freespace +The `freespace` command returns the free space in bytes of the miner. +```sh +canined q storage freespace [miner-address] +``` +#### get-client-free-space +The `get-client-free-space` command takes an address and returns the total data they have available to use in bytes. +```sh +canined q storage get-client-free-space [address] +``` +#### list-pay-blocks +The `list-pay-blocks` command lists all of the payblocks created by users. +```sh +canined q storage list-pay-blocks +``` +### show-pay-blocks +The `show-pay-blocks` command shows information about a single pay block. +```sh +canined q storage show-pay-blocks [blockid] +``` +#### list-strays +The `list-strays` command lists all of stray contracts. +```sh +canined q storage list-strays +``` +### show-strays +The `show-strays` command shows information about a single stray contract from a given contract id (cid). +```sh +canined q storage show-strays [cid] +``` +#### params +The `params` command allows users to view the params of the module. +```sh +canined q storage params +``` + +### Transactions +The `tx` commands allow users to interact with the `storage` module. +```sh +canined tx storage --help +``` +#### init-miner +The `init-miner` command posts a miner's interface info alongside the total storage offered by the miner. +```sh +canined tx storage init-miner [ip-address] [total-size] +``` +#### set-miner-ip +The `set-miner-ip` command updates a miner's IP address. +```sh +canined tx storage set-miner-ip [ip] +``` +#### set-miner-totalspace +The `set-miner-totalspace` command updates a miner's total space available. +```sh +canined tx storage set-miner-totalspace [total-space] +``` +#### sign-contract +The `sign-contract` command signs a contract by passing in the contract id. +```sh +canined tx storage sign-contract [cid] +``` +#### post-contract +The `post-contract` command posts a contract to the blockchain from a miner. +```sh +canined tx storage post-contract [hashes] [signee] [duration] [filesize] [file-id] +``` +### postproof +The `postproof` command allows storage providers to post a proof claiming they have the file available. +```sh +canined tx storage postproof [chunk_data] [proof_data] +``` +### buy-storage +The `buy-storage` command allows users to pay for a specific amount of storage for a specified period of time. +```sh +canined tx storage buy-storage [address] [duration] [byte-amount] [payment-denom] +``` +### cancel-contract +The `cancel-contract` command allows users to cancel currently active contracts removing the data usage from their account. +```sh +canined tx storage cancel-contract [cid] +``` diff --git a/x/storage/abci.go b/x/storage/abci.go new file mode 100644 index 000000000..3d9338e1a --- /dev/null +++ b/x/storage/abci.go @@ -0,0 +1,16 @@ +package storage + +import ( + "time" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { + defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + + k.HandleBlock(ctx) +} diff --git a/x/storage/client/cli/query.go b/x/storage/client/cli/query.go new file mode 100644 index 000000000..5b6cc98e9 --- /dev/null +++ b/x/storage/client/cli/query.go @@ -0,0 +1,53 @@ +package cli + +import ( + "fmt" + // "strings" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + // sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group storage queries under a subcommand + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdQueryParams()) + cmd.AddCommand(CmdListContracts()) + cmd.AddCommand(CmdShowContracts()) + cmd.AddCommand(CmdListActiveDeals()) + cmd.AddCommand(CmdShowActiveDeals()) + cmd.AddCommand(CmdListProviders()) + cmd.AddCommand(CmdShowProviders()) + cmd.AddCommand(CmdFreespace()) + + cmd.AddCommand(CmdFindFile()) + + cmd.AddCommand(CmdListPayBlocks()) + cmd.AddCommand(CmdShowPayBlocks()) + cmd.AddCommand(CmdListClientUsage()) + cmd.AddCommand(CmdShowClientUsage()) + cmd.AddCommand(CmdListStrays()) + cmd.AddCommand(CmdShowStrays()) + cmd.AddCommand(CmdGetClientFreeSpace()) + + cmd.AddCommand(CmdListFidCid()) + cmd.AddCommand(CmdShowFidCid()) + cmd.AddCommand(CmdGetPayData()) + + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/storage/client/cli/query_active_deals.go b/x/storage/client/cli/query_active_deals.go new file mode 100644 index 000000000..37325b151 --- /dev/null +++ b/x/storage/client/cli/query_active_deals.go @@ -0,0 +1,73 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +func CmdListActiveDeals() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-active-deals", + Short: "list all active_deals", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllActiveDealsRequest{ + Pagination: pageReq, + } + + res, err := queryClient.ActiveDealsAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowActiveDeals() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-active-deals [cid]", + Short: "shows a active_deals", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + argCid := args[0] + + params := &types.QueryGetActiveDealsRequest{ + Cid: argCid, + } + + res, err := queryClient.ActiveDeals(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/query_client_usage.go b/x/storage/client/cli/query_client_usage.go new file mode 100644 index 000000000..6611a1cb5 --- /dev/null +++ b/x/storage/client/cli/query_client_usage.go @@ -0,0 +1,73 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +func CmdListClientUsage() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-client-usage", + Short: "list all client-usage", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllClientUsageRequest{ + Pagination: pageReq, + } + + res, err := queryClient.ClientUsageAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowClientUsage() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-client-usage [address]", + Short: "shows a client-usage", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + argAddress := args[0] + + params := &types.QueryGetClientUsageRequest{ + Address: argAddress, + } + + res, err := queryClient.ClientUsage(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/query_contracts.go b/x/storage/client/cli/query_contracts.go new file mode 100644 index 000000000..a81f74127 --- /dev/null +++ b/x/storage/client/cli/query_contracts.go @@ -0,0 +1,73 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +func CmdListContracts() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-contracts", + Short: "list all contracts", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllContractsRequest{ + Pagination: pageReq, + } + + res, err := queryClient.ContractsAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowContracts() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-contracts [cid]", + Short: "shows a contracts", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + argCid := args[0] + + params := &types.QueryGetContractsRequest{ + Cid: argCid, + } + + res, err := queryClient.Contracts(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/query_fid_cid.go b/x/storage/client/cli/query_fid_cid.go new file mode 100644 index 000000000..62e3669a0 --- /dev/null +++ b/x/storage/client/cli/query_fid_cid.go @@ -0,0 +1,73 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +func CmdListFidCid() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-fid-cid", + Short: "list all fid-cid", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllFidCidRequest{ + Pagination: pageReq, + } + + res, err := queryClient.FidCidAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowFidCid() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-fid-cid [fid]", + Short: "shows a fid-cid", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + argFid := args[0] + + params := &types.QueryGetFidCidRequest{ + Fid: argFid, + } + + res, err := queryClient.FidCid(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/query_find_file.go b/x/storage/client/cli/query_find_file.go new file mode 100644 index 000000000..f95091fb3 --- /dev/null +++ b/x/storage/client/cli/query_find_file.go @@ -0,0 +1,45 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdFindFile() *cobra.Command { + cmd := &cobra.Command{ + Use: "find-file [fid]", + Short: "Query find-file", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + reqFid := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryFindFileRequest{ + Fid: reqFid, + } + + res, err := queryClient.FindFile(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/query_freespace.go b/x/storage/client/cli/query_freespace.go new file mode 100644 index 000000000..03f0debe9 --- /dev/null +++ b/x/storage/client/cli/query_freespace.go @@ -0,0 +1,45 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdFreespace() *cobra.Command { + cmd := &cobra.Command{ + Use: "freespace [address]", + Short: "Query freespace", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + reqAddress := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryFreespaceRequest{ + Address: reqAddress, + } + + res, err := queryClient.Freespace(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/query_get_client_free_space.go b/x/storage/client/cli/query_get_client_free_space.go new file mode 100644 index 000000000..d53ab10f2 --- /dev/null +++ b/x/storage/client/cli/query_get_client_free_space.go @@ -0,0 +1,45 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdGetClientFreeSpace() *cobra.Command { + cmd := &cobra.Command{ + Use: "get-client-free-space [address]", + Short: "Queries the amount of storage a user has available", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + reqAddress := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryGetClientFreeSpaceRequest{ + Address: reqAddress, + } + + res, err := queryClient.GetClientFreeSpace(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/query_get_pay_data.go b/x/storage/client/cli/query_get_pay_data.go new file mode 100644 index 000000000..ccce768e8 --- /dev/null +++ b/x/storage/client/cli/query_get_pay_data.go @@ -0,0 +1,45 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdGetPayData() *cobra.Command { + cmd := &cobra.Command{ + Use: "get-pay-data [address]", + Short: "get all payment info from account", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + reqAddress := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryGetPayDataRequest{ + Address: reqAddress, + } + + res, err := queryClient.GetPayData(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/query_miners.go b/x/storage/client/cli/query_miners.go new file mode 100644 index 000000000..3e7cd24d2 --- /dev/null +++ b/x/storage/client/cli/query_miners.go @@ -0,0 +1,73 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +func CmdListProviders() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-providers", + Short: "list all providers", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllProvidersRequest{ + Pagination: pageReq, + } + + res, err := queryClient.ProvidersAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowProviders() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-providers [address]", + Short: "shows a providers", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + argAddress := args[0] + + params := &types.QueryGetProvidersRequest{ + Address: argAddress, + } + + res, err := queryClient.Providers(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/query_params.go b/x/storage/client/cli/query_params.go new file mode 100644 index 000000000..8d2ed7d7c --- /dev/null +++ b/x/storage/client/cli/query_params.go @@ -0,0 +1,34 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +func CmdQueryParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Short: "shows the parameters of the module", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/query_pay_blocks.go b/x/storage/client/cli/query_pay_blocks.go new file mode 100644 index 000000000..a0c2c3c36 --- /dev/null +++ b/x/storage/client/cli/query_pay_blocks.go @@ -0,0 +1,73 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +func CmdListPayBlocks() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-pay-blocks", + Short: "list all pay-blocks", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllPayBlocksRequest{ + Pagination: pageReq, + } + + res, err := queryClient.PayBlocksAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowPayBlocks() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-pay-blocks [blockid]", + Short: "shows a pay-blocks", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + argBlockid := args[0] + + params := &types.QueryGetPayBlocksRequest{ + Blockid: argBlockid, + } + + res, err := queryClient.PayBlocks(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/query_strays.go b/x/storage/client/cli/query_strays.go new file mode 100644 index 000000000..7ce11e2e0 --- /dev/null +++ b/x/storage/client/cli/query_strays.go @@ -0,0 +1,73 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +func CmdListStrays() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-strays", + Short: "list all strays", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllStraysRequest{ + Pagination: pageReq, + } + + res, err := queryClient.StraysAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowStrays() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-strays [cid]", + Short: "shows a strays", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + argCid := args[0] + + params := &types.QueryGetStraysRequest{ + Cid: argCid, + } + + res, err := queryClient.Strays(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/tx.go b/x/storage/client/cli/tx.go new file mode 100644 index 000000000..c4e064eaf --- /dev/null +++ b/x/storage/client/cli/tx.go @@ -0,0 +1,38 @@ +package cli + +import ( + "fmt" + "time" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdPostContract()) + cmd.AddCommand(CmdPostproof()) + cmd.AddCommand(CmdSignContract()) + cmd.AddCommand(CmdSetProviderIP()) + cmd.AddCommand(CmdSetProviderTotalspace()) + cmd.AddCommand(CmdInitProvider()) + cmd.AddCommand(CmdCancelContract()) + cmd.AddCommand(CmdBuyStorage()) + cmd.AddCommand(CmdClaimStray()) + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/storage/client/cli/tx_buy_storage.go b/x/storage/client/cli/tx_buy_storage.go new file mode 100644 index 000000000..4bbfbe2d2 --- /dev/null +++ b/x/storage/client/cli/tx_buy_storage.go @@ -0,0 +1,48 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdBuyStorage() *cobra.Command { + cmd := &cobra.Command{ + Use: "buy-storage [for-address] [duration] [bytes] [payment-denom]", + Short: "Broadcast message buy-storage", + Args: cobra.ExactArgs(4), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argForAddress := args[0] + argDuration := args[1] + argBytes := args[2] + argPaymentDenom := args[3] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgBuyStorage( + clientCtx.GetFromAddress().String(), + argForAddress, + argDuration, + argBytes, + argPaymentDenom, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/tx_cancel_contract.go b/x/storage/client/cli/tx_cancel_contract.go new file mode 100644 index 000000000..7f9389fa3 --- /dev/null +++ b/x/storage/client/cli/tx_cancel_contract.go @@ -0,0 +1,42 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdCancelContract() *cobra.Command { + cmd := &cobra.Command{ + Use: "cancel-contract [cid]", + Short: "Broadcast message cancel-contract", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argCid := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgCancelContract( + clientCtx.GetFromAddress().String(), + argCid, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/tx_claim_stray.go b/x/storage/client/cli/tx_claim_stray.go new file mode 100644 index 000000000..03575eeb3 --- /dev/null +++ b/x/storage/client/cli/tx_claim_stray.go @@ -0,0 +1,42 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdClaimStray() *cobra.Command { + cmd := &cobra.Command{ + Use: "claim-stray [cid]", + Short: "claim a stray from the pile", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argCid := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgClaimStray( + clientCtx.GetFromAddress().String(), + argCid, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/tx_init_provider.go b/x/storage/client/cli/tx_init_provider.go new file mode 100644 index 000000000..276b00d32 --- /dev/null +++ b/x/storage/client/cli/tx_init_provider.go @@ -0,0 +1,44 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdInitProvider() *cobra.Command { + cmd := &cobra.Command{ + Use: "init-provider [ip] [totalspace]", + Short: "Broadcast message init-provider", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argIP := args[0] + argTotalspace := args[1] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgInitProvider( + clientCtx.GetFromAddress().String(), + argIP, + argTotalspace, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/tx_post_contract.go b/x/storage/client/cli/tx_post_contract.go new file mode 100644 index 000000000..9e2057b5f --- /dev/null +++ b/x/storage/client/cli/tx_post_contract.go @@ -0,0 +1,48 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdPostContract() *cobra.Command { + cmd := &cobra.Command{ + Use: "post-contract [hashes] [signee] [filesize] [fid]", + Short: "Broadcast message post-contract", + Args: cobra.ExactArgs(4), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argHashes := args[0] + argSignee := args[1] + argFilesize := args[2] + argFid := args[3] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgPostContract( + clientCtx.GetFromAddress().String(), + argHashes, + argSignee, + argFilesize, + argFid, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/tx_postproof.go b/x/storage/client/cli/tx_postproof.go new file mode 100644 index 000000000..d897b49cd --- /dev/null +++ b/x/storage/client/cli/tx_postproof.go @@ -0,0 +1,45 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdPostproof() *cobra.Command { + cmd := &cobra.Command{ + Use: "postproof [item] [hashlist]", + Short: "Broadcast message postproof", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argItem := args[0] + argHashlist := args[1] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgPostproof( + clientCtx.GetFromAddress().String(), + argItem, + argHashlist, + "", + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/tx_set_provider_ip.go b/x/storage/client/cli/tx_set_provider_ip.go new file mode 100644 index 000000000..399f2d585 --- /dev/null +++ b/x/storage/client/cli/tx_set_provider_ip.go @@ -0,0 +1,42 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdSetProviderIP() *cobra.Command { + cmd := &cobra.Command{ + Use: "set-provider-ip [ip]", + Short: "Broadcast message set-provider-ip", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argIP := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgSetProviderIP( + clientCtx.GetFromAddress().String(), + argIP, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/tx_set_provider_totalspace.go b/x/storage/client/cli/tx_set_provider_totalspace.go new file mode 100644 index 000000000..c8a16d554 --- /dev/null +++ b/x/storage/client/cli/tx_set_provider_totalspace.go @@ -0,0 +1,42 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdSetProviderTotalspace() *cobra.Command { + cmd := &cobra.Command{ + Use: "set-provider-totalspace [space]", + Short: "Broadcast message set-provider-totalspace", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argSpace := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgSetProviderTotalspace( + clientCtx.GetFromAddress().String(), + argSpace, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/tx_sign_contract.go b/x/storage/client/cli/tx_sign_contract.go new file mode 100644 index 000000000..0df36ad9b --- /dev/null +++ b/x/storage/client/cli/tx_sign_contract.go @@ -0,0 +1,42 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdSignContract() *cobra.Command { + cmd := &cobra.Command{ + Use: "sign-contract [cid]", + Short: "Broadcast message sign-contract", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argCid := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgSignContract( + clientCtx.GetFromAddress().String(), + argCid, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/genesis.go b/x/storage/genesis.go new file mode 100644 index 000000000..69f65ed15 --- /dev/null +++ b/x/storage/genesis.go @@ -0,0 +1,59 @@ +package storage + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// InitGenesis initializes the capability module's state from a provided genesis +// state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + // Set all the contracts + for _, elem := range genState.ContractsList { + k.SetContracts(ctx, elem) + } + // Set all the activeDeals + for _, elem := range genState.ActiveDealsList { + k.SetActiveDeals(ctx, elem) + } + // Set all the Providers + for _, elem := range genState.ProvidersList { + k.SetProviders(ctx, elem) + } + // Set all the payBlocks + for _, elem := range genState.PayBlocksList { + k.SetPayBlocks(ctx, elem) + } + // Set all the clientUsage + for _, elem := range genState.ClientUsageList { + k.SetClientUsage(ctx, elem) + } + // Set all the strays + for _, elem := range genState.StraysList { + k.SetStrays(ctx, elem) + } + // Set all the fidCid + for _, elem := range genState.FidCidList { + k.SetFidCid(ctx, elem) + } + // this line is used by starport scaffolding # genesis/module/init + k.SetParams(ctx, genState.Params) +} + +// ExportGenesis returns the capability module's exported genesis. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + genesis.Params = k.GetParams(ctx) + + genesis.ContractsList = k.GetAllContracts(ctx) + genesis.ActiveDealsList = k.GetAllActiveDeals(ctx) + genesis.ProvidersList = k.GetAllProviders(ctx) + genesis.PayBlocksList = k.GetAllPayBlocks(ctx) + genesis.ClientUsageList = k.GetAllClientUsage(ctx) + genesis.StraysList = k.GetAllStrays(ctx) + genesis.FidCidList = k.GetAllFidCid(ctx) + // this line is used by starport scaffolding # genesis/module/export + + return genesis +} diff --git a/x/storage/handler.go b/x/storage/handler.go new file mode 100644 index 000000000..a569c0e1a --- /dev/null +++ b/x/storage/handler.go @@ -0,0 +1,53 @@ +package storage + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// NewHandler ... +func NewHandler(k keeper.Keeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { + ctx = ctx.WithEventManager(sdk.NewEventManager()) + + switch msg := msg.(type) { + case *types.MsgPostContract: + res, err := msgServer.PostContract(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgPostproof: + res, err := msgServer.Postproof(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgSignContract: + res, err := msgServer.SignContract(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgSetProviderIP: + res, err := msgServer.SetProviderIP(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgSetProviderTotalspace: + res, err := msgServer.SetProviderTotalspace(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgInitProvider: + res, err := msgServer.InitProvider(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgCancelContract: + res, err := msgServer.CancelContract(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgBuyStorage: + res, err := msgServer.BuyStorage(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgClaimStray: + res, err := msgServer.ClaimStray(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + // this line is used by starport scaffolding # 1 + default: + errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + } + } +} diff --git a/x/storage/keeper/active_deals.go b/x/storage/keeper/active_deals.go new file mode 100644 index 000000000..3232340b1 --- /dev/null +++ b/x/storage/keeper/active_deals.go @@ -0,0 +1,61 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// SetActiveDeals set a specific activeDeals in the store from its index +func (k Keeper) SetActiveDeals(ctx sdk.Context, activeDeals types.ActiveDeals) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ActiveDealsKeyPrefix)) + b := k.cdc.MustMarshal(&activeDeals) + store.Set(types.ActiveDealsKey( + activeDeals.Cid, + ), b) +} + +// GetActiveDeals returns a activeDeals from its index +func (k Keeper) GetActiveDeals( + ctx sdk.Context, + cid string, +) (val types.ActiveDeals, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ActiveDealsKeyPrefix)) + + b := store.Get(types.ActiveDealsKey( + cid, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveActiveDeals removes a activeDeals from the store +func (k Keeper) RemoveActiveDeals( + ctx sdk.Context, + cid string, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ActiveDealsKeyPrefix)) + store.Delete(types.ActiveDealsKey( + cid, + )) +} + +// GetAllActiveDeals returns all activeDeals +func (k Keeper) GetAllActiveDeals(ctx sdk.Context) (list []types.ActiveDeals) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ActiveDealsKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.ActiveDeals + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/storage/keeper/client_usage.go b/x/storage/keeper/client_usage.go new file mode 100644 index 000000000..12ddca8d5 --- /dev/null +++ b/x/storage/keeper/client_usage.go @@ -0,0 +1,61 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// SetClientUsage set a specific clientUsage in the store from its index +func (k Keeper) SetClientUsage(ctx sdk.Context, clientUsage types.ClientUsage) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ClientUsageKeyPrefix)) + b := k.cdc.MustMarshal(&clientUsage) + store.Set(types.ClientUsageKey( + clientUsage.Address, + ), b) +} + +// GetClientUsage returns a clientUsage from its index +func (k Keeper) GetClientUsage( + ctx sdk.Context, + address string, +) (val types.ClientUsage, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ClientUsageKeyPrefix)) + + b := store.Get(types.ClientUsageKey( + address, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveClientUsage removes a clientUsage from the store +func (k Keeper) RemoveClientUsage( + ctx sdk.Context, + address string, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ClientUsageKeyPrefix)) + store.Delete(types.ClientUsageKey( + address, + )) +} + +// GetAllClientUsage returns all clientUsage +func (k Keeper) GetAllClientUsage(ctx sdk.Context) (list []types.ClientUsage) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ClientUsageKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.ClientUsage + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/storage/keeper/client_usage_test.go b/x/storage/keeper/client_usage_test.go new file mode 100644 index 000000000..b60df9ef0 --- /dev/null +++ b/x/storage/keeper/client_usage_test.go @@ -0,0 +1,57 @@ +package keeper_test + +import ( + "strconv" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createClientUsage(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.ClientUsage { + items := make([]types.ClientUsage, n) + for i := range items { + items[i].Address = strconv.Itoa(i) + items[i].Usage = strconv.Itoa(i) + + keeper.SetClientUsage(ctx, items[i]) + } + return items +} + +func (suite *KeeperTestSuite) TestGetClientUsage() { + k := suite.storageKeeper + ctx := suite.ctx + + items := createClientUsage(k, ctx, 10) + for _, item := range items { + rst, found := k.GetClientUsage(ctx, item.Address) + suite.Require().True(found) + suite.Equal(item, rst) + } +} + +func (suite *KeeperTestSuite) TestRemoveClientUsage() { + k := suite.storageKeeper + ctx := suite.ctx + + items := createClientUsage(k, ctx, 10) + for _, item := range items { + k.RemoveClientUsage(ctx, item.Address) + + rst, found := k.GetClientUsage(ctx, item.Address) + suite.Require().Empty(rst) + suite.Require().False(found) + } +} + +func (suite *KeeperTestSuite) TestGetAllClientUsage() { + k := suite.storageKeeper + ctx := suite.ctx + + items := createClientUsage(k, ctx, 10) + suite.Require().Equal(items, k.GetAllClientUsage(ctx)) +} diff --git a/x/storage/keeper/common_test.go b/x/storage/keeper/common_test.go new file mode 100644 index 000000000..d3dc33062 --- /dev/null +++ b/x/storage/keeper/common_test.go @@ -0,0 +1,99 @@ +package keeper_test + +import ( + "fmt" + "testing" + + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" + + "github.com/cosmos/cosmos-sdk/baseapp" + + storetypes "github.com/cosmos/cosmos-sdk/store/types" + typesparams "github.com/cosmos/cosmos-sdk/x/params/types" + + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + + moduletestutil "github.com/jackalLabs/canine-chain/types/module/testutil" // when importing from sdk,'go mod tidy' keeps trying to import from v0.46. + + sdk "github.com/cosmos/cosmos-sdk/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/golang/mock/gomock" + canineglobaltestutil "github.com/jackalLabs/canine-chain/testutil" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + storagetestutil "github.com/jackalLabs/canine-chain/x/storage/testutil" + types "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// setupStorageKeeper creates a storageKeeper as well as all its dependencies. +func setupStorageKeeper(t *testing.T) ( + *keeper.Keeper, + *storagetestutil.MockBankKeeper, + *storagetestutil.MockAccountKeeper, + moduletestutil.TestEncodingConfig, + sdk.Context, +) { + key := sdk.NewKVStoreKey(types.StoreKey) + memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) + testCtx := canineglobaltestutil.DefaultContextWithDB(t, key, sdk.NewTransientStoreKey("transient_test")) + ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: tmtime.Now()}) + + encCfg := moduletestutil.MakeTestEncodingConfig() + types.RegisterInterfaces(encCfg.InterfaceRegistry) + banktypes.RegisterInterfaces(encCfg.InterfaceRegistry) + + // Create MsgServiceRouter, but don't populate it before creating the storage keeper. + msr := baseapp.NewMsgServiceRouter() + + // gomock initializations + ctrl := gomock.NewController(t) + bankKeeper := storagetestutil.NewMockBankKeeper(ctrl) + accountKeeper := storagetestutil.NewMockAccountKeeper(ctrl) + trackMockBalances(bankKeeper) + + paramsSubspace := typesparams.NewSubspace(encCfg.Codec, + types.Amino, + key, + memStoreKey, + "StorageParams", + ) + + // storage keeper initializations + storageKeeper := keeper.NewKeeper(encCfg.Codec, key, memStoreKey, paramsSubspace, bankKeeper, accountKeeper) + storageKeeper.SetParams(ctx, types.DefaultParams()) + + // Register all handlers for the MegServiceRouter. + msr.SetInterfaceRegistry(encCfg.InterfaceRegistry) + types.RegisterMsgServer(msr, keeper.NewMsgServerImpl(*storageKeeper)) + banktypes.RegisterMsgServer(msr, nil) // Nil is fine here as long as we never execute the proposal's Msgs. + + return storageKeeper, bankKeeper, accountKeeper, encCfg, ctx +} + +// trackMockBalances sets up expected calls on the Mock BankKeeper, and also +// locally tracks accounts balances (not modules balances). +func trackMockBalances(bankKeeper *storagetestutil.MockBankKeeper) { + balances := make(map[string]sdk.Coins) + + // We don't track module account balances. + bankKeeper.EXPECT().MintCoins(gomock.Any(), minttypes.ModuleName, gomock.Any()).AnyTimes() + bankKeeper.EXPECT().BurnCoins(gomock.Any(), types.ModuleName, gomock.Any()).AnyTimes() + bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), minttypes.ModuleName, types.ModuleName, gomock.Any()).AnyTimes() + + // But we do track normal account balances. + bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), types.ModuleName, gomock.Any()).DoAndReturn(func(_ sdk.Context, sender sdk.AccAddress, _ string, coins sdk.Coins) error { + newBalance, negative := balances[sender.String()].SafeSub(coins) // in v0.46, this method is variadic + if negative { + return fmt.Errorf("not enough balance") + } + balances[sender.String()] = newBalance + return nil + }).AnyTimes() + bankKeeper.EXPECT().SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(_ sdk.Context, module string, rcpt sdk.AccAddress, coins sdk.Coins) error { + balances[rcpt.String()] = balances[rcpt.String()].Add(coins...) + return nil + }).AnyTimes() + bankKeeper.EXPECT().GetAllBalances(gomock.Any(), gomock.Any()).DoAndReturn(func(_ sdk.Context, addr sdk.AccAddress) sdk.Coins { + return balances[addr.String()] + }).AnyTimes() +} diff --git a/x/storage/keeper/contract_test.go b/x/storage/keeper/contract_test.go new file mode 100644 index 000000000..d6f4fbe82 --- /dev/null +++ b/x/storage/keeper/contract_test.go @@ -0,0 +1,477 @@ +package keeper_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// testing: contracts.go active_deals.go... +func (suite *KeeperTestSuite) TestSetContracts() { + suite.SetupSuite() + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + provider, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + + contract := types.Contracts{ + Cid: "549", + Merkle: "", + Signee: user.String(), + Duration: "1000", + Filesize: "5000", + Fid: "5789", + Creator: provider.String(), + } + + suite.storageKeeper.SetContracts(suite.ctx, contract) + suite.Require().NoError(err) + + contractRequest := types.QueryGetContractsRequest{ + Cid: "549", + } + + res, err := suite.queryClient.Contracts(suite.ctx.Context(), &contractRequest) + suite.Require().NoError(err) + suite.Require().Equal(res.Contracts.Cid, contract.Cid) + suite.Require().Equal(res.Contracts.Signee, contract.Signee) +} + +func (suite *KeeperTestSuite) TestGetContracts() { + suite.SetupSuite() + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + provider, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + + contract := types.Contracts{ + Cid: "549", + Merkle: "", + Signee: user.String(), + Duration: "1000", + Filesize: "5000", + Fid: "5789", + Creator: provider.String(), + } + + suite.storageKeeper.SetContracts(suite.ctx, contract) + suite.Require().NoError(err) + + foundContract, found := suite.storageKeeper.GetContracts(suite.ctx, "549") + + suite.Require().NoError(err) + suite.Require().Equal(found, true) + suite.Require().Equal(foundContract.Cid, contract.Cid) + suite.Require().Equal(foundContract.Signee, contract.Signee) +} + +func (suite *KeeperTestSuite) TestGetAllContracts() { + suite.SetupSuite() + + provider, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + + alice, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + charlie, err := sdk.AccAddressFromBech32("cosmos1xetrp5dwjplsn4lev5r2cu8en5qsq824vza9nu") + suite.Require().NoError(err) + + contract := types.Contracts{ + Cid: "549", + Merkle: "", + Signee: alice.String(), + Duration: "1000", + Filesize: "5000", + Fid: "5789", + Creator: provider.String(), + } + + suite.storageKeeper.SetContracts(suite.ctx, contract) + suite.Require().NoError(err) + + contract1 := types.Contracts{ + Cid: "649", + Merkle: "", + Signee: charlie.String(), + Duration: "2000", + Filesize: "10000", + Fid: "4587", + Creator: provider.String(), + } + + suite.storageKeeper.SetContracts(suite.ctx, contract1) + suite.Require().NoError(err) + + allContracts := suite.storageKeeper.GetAllContracts(suite.ctx) + aliceContract := allContracts[0] + charlieContract := allContracts[1] + + suite.Require().NoError(err) + suite.Require().Equal(aliceContract, contract) + suite.Require().Equal(charlieContract, contract1) +} + +func (suite *KeeperTestSuite) TestRemoveContracts() { + suite.SetupSuite() + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + provider, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + + contract := types.Contracts{ + Cid: "549", + Merkle: "", + Signee: user.String(), + Duration: "1000", + Filesize: "5000", + Fid: "5789", + Creator: provider.String(), + } + + suite.storageKeeper.SetContracts(suite.ctx, contract) + suite.Require().NoError(err) + + suite.storageKeeper.RemoveContracts(suite.ctx, "549") + + foundContract, found := suite.storageKeeper.GetContracts(suite.ctx, "549") + + ghostContract := types.Contracts{} + + suite.Require().NoError(err) + suite.Require().Equal(found, false) + suite.Require().Equal(foundContract, ghostContract) +} + +func (suite *KeeperTestSuite) TestSetActiveDeals() { + suite.SetupSuite() + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + provider, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + + deal := types.ActiveDeals{ + Cid: "549", + Signee: user.String(), + Provider: provider.String(), + Startblock: "100", + Endblock: "1000", + Filesize: "5000", + Proofverified: "true", + Proofsmissed: "0", + Blocktoprove: "150", + Creator: user.String(), + Merkle: "", + Fid: "5789", + } + + suite.storageKeeper.SetActiveDeals(suite.ctx, deal) + suite.Require().NoError(err) + + dealRequest := types.QueryGetActiveDealsRequest{ + Cid: "549", + } + + res, err := suite.queryClient.ActiveDeals(suite.ctx.Context(), &dealRequest) + suite.Require().NoError(err) + suite.Require().Equal(res.ActiveDeals.Cid, deal.Cid) + suite.Require().Equal(res.ActiveDeals.Signee, deal.Signee) +} + +func (suite *KeeperTestSuite) TestGetActiveDeals() { + suite.SetupSuite() + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + provider, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + + deal := types.ActiveDeals{ + Cid: "549", + Signee: user.String(), + Provider: provider.String(), + Startblock: "100", + Endblock: "1000", + Filesize: "5000", + Proofverified: "true", + Proofsmissed: "0", + Blocktoprove: "150", + Creator: user.String(), + Merkle: "", + Fid: "5789", + } + + suite.storageKeeper.SetActiveDeals(suite.ctx, deal) + suite.Require().NoError(err) + + foundDeal, found := suite.storageKeeper.GetActiveDeals(suite.ctx, "549") + + suite.Require().NoError(err) + suite.Require().Equal(found, true) + suite.Require().Equal(foundDeal.Cid, deal.Cid) + suite.Require().Equal(foundDeal.Signee, deal.Signee) +} + +func (suite *KeeperTestSuite) TestGetAllActiveDeals() { + suite.SetupSuite() + + provider, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + + alice, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + charlie, err := sdk.AccAddressFromBech32("cosmos1xetrp5dwjplsn4lev5r2cu8en5qsq824vza9nu") + suite.Require().NoError(err) + + deal := types.ActiveDeals{ + Cid: "549", + Signee: alice.String(), + Provider: provider.String(), + Startblock: "100", + Endblock: "1000", + Filesize: "5000", + Proofverified: "true", + Proofsmissed: "0", + Blocktoprove: "150", + Creator: alice.String(), + Merkle: "", + Fid: "5789", + } + + suite.storageKeeper.SetActiveDeals(suite.ctx, deal) + suite.Require().NoError(err) + + deal1 := types.ActiveDeals{ + Cid: "1458", + Signee: charlie.String(), + Provider: provider.String(), + Startblock: "200", + Endblock: "2000", + Filesize: "10000", + Proofverified: "true", + Proofsmissed: "0", + Blocktoprove: "200", + Creator: charlie.String(), + Merkle: "", + Fid: "4589", + } + + suite.storageKeeper.SetActiveDeals(suite.ctx, deal1) + suite.Require().NoError(err) + + allDeals := suite.storageKeeper.GetAllActiveDeals(suite.ctx) + aliceDeal := allDeals[1] + charleDeal := allDeals[0] + + suite.Require().NoError(err) + suite.Require().Equal(aliceDeal, deal) + suite.Require().Equal(charleDeal, deal1) +} + +func (suite *KeeperTestSuite) TestRemoveActiveDeals() { + suite.SetupSuite() + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + provider, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + + deal := types.ActiveDeals{ + Cid: "549", + Signee: user.String(), + Provider: provider.String(), + Startblock: "100", + Endblock: "1000", + Filesize: "5000", + Proofverified: "true", + Proofsmissed: "0", + Blocktoprove: "150", + Creator: user.String(), + Merkle: "", + Fid: "5789", + } + + suite.storageKeeper.SetActiveDeals(suite.ctx, deal) + suite.Require().NoError(err) + + suite.storageKeeper.RemoveActiveDeals(suite.ctx, "549") + + foundDeal, found := suite.storageKeeper.GetActiveDeals(suite.ctx, "549") + + ghostDeal := types.ActiveDeals{} + + suite.Require().NoError(err) + suite.Require().Equal(found, false) + suite.Require().Equal(foundDeal, ghostDeal) +} + +func (suite *KeeperTestSuite) TestSetStrays() { + suite.SetupSuite() + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + stray := types.Strays{ + Cid: "549", + Fid: "5789", + Signee: user.String(), + Filesize: "1000", + Merkle: "", + } + suite.storageKeeper.SetStrays(suite.ctx, stray) + suite.Require().NoError(err) + + strayRequest := types.QueryGetStraysRequest{ + Cid: "549", + } + + res, err := suite.queryClient.Strays(suite.ctx.Context(), &strayRequest) + suite.Require().NoError(err) + suite.Require().Equal(res.Strays.Cid, stray.Cid) + suite.Require().Equal(res.Strays.Fid, stray.Fid) +} + +func (suite *KeeperTestSuite) TestGetStrays() { + suite.SetupSuite() + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + stray := types.Strays{ + Cid: "549", + Fid: "5789", + Signee: user.String(), + Filesize: "1000", + Merkle: "", + } + suite.storageKeeper.SetStrays(suite.ctx, stray) + suite.Require().NoError(err) + + foundStray, found := suite.storageKeeper.GetStrays(suite.ctx, "549") + + suite.Require().NoError(err) + suite.Require().Equal(found, true) + suite.Require().Equal(foundStray.Cid, stray.Cid) + suite.Require().Equal(foundStray.Fid, stray.Fid) +} + +func (suite *KeeperTestSuite) TestGetAllStrays() { + suite.SetupSuite() + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + stray := types.Strays{ + Cid: "549", + Fid: "5789", + Signee: user.String(), + Filesize: "1000", + Merkle: "", + } + suite.storageKeeper.SetStrays(suite.ctx, stray) + suite.Require().NoError(err) + + stray1 := types.Strays{ + Cid: "649", + Fid: "5789", + Signee: user.String(), + Filesize: "1000", + Merkle: "", + } + suite.storageKeeper.SetStrays(suite.ctx, stray1) + suite.Require().NoError(err) + + foundStrays := suite.storageKeeper.GetAllStrays(suite.ctx) + foundStayZero := foundStrays[0] + foundStayOne := foundStrays[1] + + suite.Require().NoError(err) + suite.Require().Equal(foundStayZero, stray) + suite.Require().Equal(foundStayOne, stray1) +} + +func (suite *KeeperTestSuite) TestRemoveStrays() { + suite.SetupSuite() + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + stray := types.Strays{ + Cid: "549", + Fid: "5789", + Signee: user.String(), + Filesize: "1000", + Merkle: "", + } + suite.storageKeeper.SetStrays(suite.ctx, stray) + suite.Require().NoError(err) + + suite.storageKeeper.RemoveStrays(suite.ctx, "549") + + foundStray, found := suite.storageKeeper.GetStrays(suite.ctx, "549") + ghostStray := types.Strays{} + + suite.Require().NoError(err) + suite.Require().Equal(found, false) + suite.Require().Equal(foundStray, ghostStray) +} + +func (suite *KeeperTestSuite) TestSetFidCid() { + suite.SetupSuite() + + FidCid := types.FidCid{Fid: "549", Cids: "['628', '629', '630']"} + + suite.storageKeeper.SetFidCid(suite.ctx, FidCid) + + FidCidRequest := types.QueryGetFidCidRequest{ + Fid: "549", + } + + res, err := suite.queryClient.FidCid(suite.ctx.Context(), &FidCidRequest) + suite.Require().NoError(err) + suite.Require().Equal(res.FidCid.Fid, FidCid.Fid) +} + +func (suite *KeeperTestSuite) TestGetFidCid() { + suite.SetupSuite() + + FidCid := types.FidCid{Fid: "549", Cids: "['628', '629', '630']"} + + suite.storageKeeper.SetFidCid(suite.ctx, FidCid) + + foundFidCid, found := suite.storageKeeper.GetFidCid(suite.ctx, "549") + + suite.Require().Equal(found, true) + suite.Require().Equal(foundFidCid.Fid, FidCid.Fid) +} + +func (suite *KeeperTestSuite) TestGetAllFidCid() { + suite.SetupSuite() + + FidCid := types.FidCid{Fid: "549", Cids: "['628', '629', '630']"} + + suite.storageKeeper.SetFidCid(suite.ctx, FidCid) + + FidCid1 := types.FidCid{Fid: "649", Cids: "['728', '729', '730']"} + + suite.storageKeeper.SetFidCid(suite.ctx, FidCid1) + + foundAllFidCid := suite.storageKeeper.GetAllFidCid(suite.ctx) + + suite.Require().Equal(foundAllFidCid[0], FidCid) + suite.Require().Equal(foundAllFidCid[1], FidCid1) +} + +func (suite *KeeperTestSuite) TestRemoveFidCid() { + suite.SetupSuite() + + FidCid := types.FidCid{Fid: "549", Cids: "['628', '629', '630']"} + suite.storageKeeper.SetFidCid(suite.ctx, FidCid) + + suite.storageKeeper.RemoveFidCid(suite.ctx, "549") + + foundFidCid, found := suite.storageKeeper.GetFidCid(suite.ctx, "549") + ghostFidCid := types.FidCid{} + suite.Require().Equal(found, false) + suite.Require().Equal(foundFidCid, ghostFidCid) +} diff --git a/x/storage/keeper/contracts.go b/x/storage/keeper/contracts.go new file mode 100644 index 000000000..0b2be8a89 --- /dev/null +++ b/x/storage/keeper/contracts.go @@ -0,0 +1,61 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// SetContracts set a specific contracts in the store from its index +func (k Keeper) SetContracts(ctx sdk.Context, contracts types.Contracts) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ContractsKeyPrefix)) + b := k.cdc.MustMarshal(&contracts) + store.Set(types.ContractsKey( + contracts.Cid, + ), b) +} + +// GetContracts returns a contracts from its index +func (k Keeper) GetContracts( + ctx sdk.Context, + cid string, +) (val types.Contracts, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ContractsKeyPrefix)) + + b := store.Get(types.ContractsKey( + cid, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveContracts removes a contracts from the store +func (k Keeper) RemoveContracts( + ctx sdk.Context, + cid string, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ContractsKeyPrefix)) + store.Delete(types.ContractsKey( + cid, + )) +} + +// GetAllContracts returns all contracts +func (k Keeper) GetAllContracts(ctx sdk.Context) (list []types.Contracts) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ContractsKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Contracts + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/storage/keeper/fid_cid.go b/x/storage/keeper/fid_cid.go new file mode 100644 index 000000000..db07f2434 --- /dev/null +++ b/x/storage/keeper/fid_cid.go @@ -0,0 +1,61 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// SetFidCid set a specific fidCid in the store from its index +func (k Keeper) SetFidCid(ctx sdk.Context, fidCid types.FidCid) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.FidCidKeyPrefix)) + b := k.cdc.MustMarshal(&fidCid) + store.Set(types.FidCidKey( + fidCid.Fid, + ), b) +} + +// GetFidCid returns a fidCid from its index +func (k Keeper) GetFidCid( + ctx sdk.Context, + fid string, +) (val types.FidCid, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.FidCidKeyPrefix)) + + b := store.Get(types.FidCidKey( + fid, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveFidCid removes a fidCid from the store +func (k Keeper) RemoveFidCid( + ctx sdk.Context, + fid string, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.FidCidKeyPrefix)) + store.Delete(types.FidCidKey( + fid, + )) +} + +// GetAllFidCid returns all fidCid +func (k Keeper) GetAllFidCid(ctx sdk.Context) (list []types.FidCid) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.FidCidKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.FidCid + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/storage/keeper/grpc_query.go b/x/storage/keeper/grpc_query.go new file mode 100644 index 000000000..a5c72d9c4 --- /dev/null +++ b/x/storage/keeper/grpc_query.go @@ -0,0 +1,7 @@ +package keeper + +import ( + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +var _ types.QueryServer = Keeper{} diff --git a/x/storage/keeper/grpc_query_active_deals.go b/x/storage/keeper/grpc_query_active_deals.go new file mode 100644 index 000000000..3481c35e5 --- /dev/null +++ b/x/storage/keeper/grpc_query_active_deals.go @@ -0,0 +1,56 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ActiveDealsAll(c context.Context, req *types.QueryAllActiveDealsRequest) (*types.QueryAllActiveDealsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var activeDealss []types.ActiveDeals + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + activeDealsStore := prefix.NewStore(store, types.KeyPrefix(types.ActiveDealsKeyPrefix)) + + pageRes, err := query.Paginate(activeDealsStore, req.Pagination, func(key []byte, value []byte) error { + var activeDeals types.ActiveDeals + if err := k.cdc.Unmarshal(value, &activeDeals); err != nil { + return err + } + + activeDealss = append(activeDealss, activeDeals) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllActiveDealsResponse{ActiveDeals: activeDealss, Pagination: pageRes}, nil +} + +func (k Keeper) ActiveDeals(c context.Context, req *types.QueryGetActiveDealsRequest) (*types.QueryGetActiveDealsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetActiveDeals( + ctx, + req.Cid, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetActiveDealsResponse{ActiveDeals: val}, nil +} diff --git a/x/storage/keeper/grpc_query_client_usage.go b/x/storage/keeper/grpc_query_client_usage.go new file mode 100644 index 000000000..37a151a4a --- /dev/null +++ b/x/storage/keeper/grpc_query_client_usage.go @@ -0,0 +1,56 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ClientUsageAll(c context.Context, req *types.QueryAllClientUsageRequest) (*types.QueryAllClientUsageResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var clientUsages []types.ClientUsage + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + clientUsageStore := prefix.NewStore(store, types.KeyPrefix(types.ClientUsageKeyPrefix)) + + pageRes, err := query.Paginate(clientUsageStore, req.Pagination, func(key []byte, value []byte) error { + var clientUsage types.ClientUsage + if err := k.cdc.Unmarshal(value, &clientUsage); err != nil { + return err + } + + clientUsages = append(clientUsages, clientUsage) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllClientUsageResponse{ClientUsage: clientUsages, Pagination: pageRes}, nil +} + +func (k Keeper) ClientUsage(c context.Context, req *types.QueryGetClientUsageRequest) (*types.QueryGetClientUsageResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetClientUsage( + ctx, + req.Address, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetClientUsageResponse{ClientUsage: val}, nil +} diff --git a/x/storage/keeper/grpc_query_contracts.go b/x/storage/keeper/grpc_query_contracts.go new file mode 100644 index 000000000..858fdd0ad --- /dev/null +++ b/x/storage/keeper/grpc_query_contracts.go @@ -0,0 +1,56 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ContractsAll(c context.Context, req *types.QueryAllContractsRequest) (*types.QueryAllContractsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var contractss []types.Contracts + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + contractsStore := prefix.NewStore(store, types.KeyPrefix(types.ContractsKeyPrefix)) + + pageRes, err := query.Paginate(contractsStore, req.Pagination, func(key []byte, value []byte) error { + var contracts types.Contracts + if err := k.cdc.Unmarshal(value, &contracts); err != nil { + return err + } + + contractss = append(contractss, contracts) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllContractsResponse{Contracts: contractss, Pagination: pageRes}, nil +} + +func (k Keeper) Contracts(c context.Context, req *types.QueryGetContractsRequest) (*types.QueryGetContractsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetContracts( + ctx, + req.Cid, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetContractsResponse{Contracts: val}, nil +} diff --git a/x/storage/keeper/grpc_query_fid_cid.go b/x/storage/keeper/grpc_query_fid_cid.go new file mode 100644 index 000000000..45f9f029c --- /dev/null +++ b/x/storage/keeper/grpc_query_fid_cid.go @@ -0,0 +1,56 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) FidCidAll(c context.Context, req *types.QueryAllFidCidRequest) (*types.QueryAllFidCidResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var fidCids []types.FidCid + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + fidCidStore := prefix.NewStore(store, types.KeyPrefix(types.FidCidKeyPrefix)) + + pageRes, err := query.Paginate(fidCidStore, req.Pagination, func(key []byte, value []byte) error { + var fidCid types.FidCid + if err := k.cdc.Unmarshal(value, &fidCid); err != nil { + return err + } + + fidCids = append(fidCids, fidCid) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllFidCidResponse{FidCid: fidCids, Pagination: pageRes}, nil +} + +func (k Keeper) FidCid(c context.Context, req *types.QueryGetFidCidRequest) (*types.QueryGetFidCidResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetFidCid( + ctx, + req.Fid, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetFidCidResponse{FidCid: val}, nil +} diff --git a/x/storage/keeper/grpc_query_find_file.go b/x/storage/keeper/grpc_query_find_file.go new file mode 100644 index 000000000..1cb84dcc6 --- /dev/null +++ b/x/storage/keeper/grpc_query_find_file.go @@ -0,0 +1,47 @@ +package keeper + +import ( + "context" + "encoding/json" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ListFiles(ctx sdk.Context, fid string) []string { + allDeals := k.GetAllActiveDeals(ctx) + + var providers []string + + for i := 0; i < len(allDeals); i++ { + if allDeals[i].Fid == fid { + provider, ok := k.GetProviders(ctx, allDeals[i].Provider) + if !ok { + continue + } + + providers = append(providers, provider.Ip) + } + } + + return providers +} + +func (k Keeper) FindFile(goCtx context.Context, req *types.QueryFindFileRequest) (*types.QueryFindFileResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + ls := k.ListFiles(ctx, req.Fid) + + ProviderIps, err := json.Marshal(ls) + if err != nil { + return nil, err + } + + return &types.QueryFindFileResponse{ProviderIps: string(ProviderIps)}, nil +} diff --git a/x/storage/keeper/grpc_query_freespace.go b/x/storage/keeper/grpc_query_freespace.go new file mode 100644 index 000000000..c43ed6c2e --- /dev/null +++ b/x/storage/keeper/grpc_query_freespace.go @@ -0,0 +1,37 @@ +package keeper + +import ( + "context" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Freespace(goCtx context.Context, req *types.QueryFreespaceRequest) (*types.QueryFreespaceResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + num := k.GetProviderUsing(ctx, req.Address) + + provider, found := k.GetProviders(ctx, req.Address) + + if !found { + return nil, fmt.Errorf("can't find provider") + } + + space, ok := sdk.NewIntFromString(provider.Totalspace) + + if !ok { + return nil, fmt.Errorf("can't parse total space") + } + + return &types.QueryFreespaceResponse{ + Space: fmt.Sprintf("%d", space.Int64()-num), + }, nil +} diff --git a/x/storage/keeper/grpc_query_get_client_free_space.go b/x/storage/keeper/grpc_query_get_client_free_space.go new file mode 100644 index 000000000..74e031812 --- /dev/null +++ b/x/storage/keeper/grpc_query_get_client_free_space.go @@ -0,0 +1,42 @@ +package keeper + +import ( + "context" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) GetClientFreeSpace(goCtx context.Context, req *types.QueryGetClientFreeSpaceRequest) (*types.QueryGetClientFreeSpaceResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + clientUsage, found := k.GetClientUsage(ctx, req.Address) + if !found { + clientUsage = types.ClientUsage{ + Address: req.Address, + Usage: "0", + } + } + + usage, ok := sdk.NewIntFromString(clientUsage.Usage) + if !ok { + return nil, fmt.Errorf("cannot parse client usage") + } + + paid, _, _ := k.GetPaidAmount(ctx, req.Address, ctx.BlockHeight()) + + if paid < usage.Int64() { + return nil, fmt.Errorf("paid amount cannot be smaller than usage") + } + + bfree := paid - usage.Int64() + + return &types.QueryGetClientFreeSpaceResponse{Bytesfree: fmt.Sprintf("%d", bfree)}, nil +} diff --git a/x/storage/keeper/grpc_query_get_pay_data.go b/x/storage/keeper/grpc_query_get_pay_data.go new file mode 100644 index 000000000..8f5b4de8f --- /dev/null +++ b/x/storage/keeper/grpc_query_get_pay_data.go @@ -0,0 +1,31 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) GetPayData(goCtx context.Context, req *types.QueryGetPayDataRequest) (*types.QueryGetPayDataResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + paid, _, block := k.GetPaidAmount(ctx, req.Address, ctx.BlockHeight()) + blocks := ctx.BlockHeight() + if block != nil { + bnum, ok := sdk.NewIntFromString(block.Blocknum) + if ok { + blocks = bnum.Int64() + } + } + + blocks -= ctx.BlockHeight() + + return &types.QueryGetPayDataResponse{BlocksRemaining: blocks, Bytes: paid}, nil +} diff --git a/x/storage/keeper/grpc_query_params.go b/x/storage/keeper/grpc_query_params.go new file mode 100644 index 000000000..343875fb3 --- /dev/null +++ b/x/storage/keeper/grpc_query_params.go @@ -0,0 +1,19 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} diff --git a/x/storage/keeper/grpc_query_pay_blocks.go b/x/storage/keeper/grpc_query_pay_blocks.go new file mode 100644 index 000000000..f763c5c90 --- /dev/null +++ b/x/storage/keeper/grpc_query_pay_blocks.go @@ -0,0 +1,56 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) PayBlocksAll(c context.Context, req *types.QueryAllPayBlocksRequest) (*types.QueryAllPayBlocksResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var payBlockss []types.PayBlocks + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + payBlocksStore := prefix.NewStore(store, types.KeyPrefix(types.PayBlocksKeyPrefix)) + + pageRes, err := query.Paginate(payBlocksStore, req.Pagination, func(key []byte, value []byte) error { + var payBlocks types.PayBlocks + if err := k.cdc.Unmarshal(value, &payBlocks); err != nil { + return err + } + + payBlockss = append(payBlockss, payBlocks) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllPayBlocksResponse{PayBlocks: payBlockss, Pagination: pageRes}, nil +} + +func (k Keeper) PayBlocks(c context.Context, req *types.QueryGetPayBlocksRequest) (*types.QueryGetPayBlocksResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetPayBlocks( + ctx, + req.Blockid, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetPayBlocksResponse{PayBlocks: val}, nil +} diff --git a/x/storage/keeper/grpc_query_providers.go b/x/storage/keeper/grpc_query_providers.go new file mode 100644 index 000000000..7bfc091ae --- /dev/null +++ b/x/storage/keeper/grpc_query_providers.go @@ -0,0 +1,56 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ProvidersAll(c context.Context, req *types.QueryAllProvidersRequest) (*types.QueryAllProvidersResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var providerss []types.Providers + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + providersStore := prefix.NewStore(store, types.KeyPrefix(types.ProvidersKeyPrefix)) + + pageRes, err := query.Paginate(providersStore, req.Pagination, func(key []byte, value []byte) error { + var providers types.Providers + if err := k.cdc.Unmarshal(value, &providers); err != nil { + return err + } + + providerss = append(providerss, providers) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllProvidersResponse{Providers: providerss, Pagination: pageRes}, nil +} + +func (k Keeper) Providers(c context.Context, req *types.QueryGetProvidersRequest) (*types.QueryGetProvidersResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetProviders( + ctx, + req.Address, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetProvidersResponse{Providers: val}, nil +} diff --git a/x/storage/keeper/grpc_query_strays.go b/x/storage/keeper/grpc_query_strays.go new file mode 100644 index 000000000..c2224aae2 --- /dev/null +++ b/x/storage/keeper/grpc_query_strays.go @@ -0,0 +1,56 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) StraysAll(c context.Context, req *types.QueryAllStraysRequest) (*types.QueryAllStraysResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var strayss []types.Strays + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + straysStore := prefix.NewStore(store, types.KeyPrefix(types.StraysKeyPrefix)) + + pageRes, err := query.Paginate(straysStore, req.Pagination, func(key []byte, value []byte) error { + var strays types.Strays + if err := k.cdc.Unmarshal(value, &strays); err != nil { + return err + } + + strayss = append(strayss, strays) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllStraysResponse{Strays: strayss, Pagination: pageRes}, nil +} + +func (k Keeper) Strays(c context.Context, req *types.QueryGetStraysRequest) (*types.QueryGetStraysResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetStrays( + ctx, + req.Cid, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetStraysResponse{Strays: val}, nil +} diff --git a/x/storage/keeper/keeper.go b/x/storage/keeper/keeper.go new file mode 100644 index 000000000..6e3440f34 --- /dev/null +++ b/x/storage/keeper/keeper.go @@ -0,0 +1,50 @@ +package keeper + +import ( + "fmt" + + "github.com/tendermint/tendermint/libs/log" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey + paramstore paramtypes.Subspace + bankkeeper types.BankKeeper + accountkeeper types.AccountKeeper + } +) + +func NewKeeper( + cdc codec.BinaryCodec, + storeKey, + memKey sdk.StoreKey, + ps paramtypes.Subspace, + bankkeeper types.BankKeeper, + accountkeeper types.AccountKeeper, +) *Keeper { + // set KeyTable if it has not already been set + if !ps.HasKeyTable() { + ps = ps.WithKeyTable(types.ParamKeyTable()) + } + + return &Keeper{ + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + paramstore: ps, + bankkeeper: bankkeeper, + accountkeeper: accountkeeper, + } +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} diff --git a/x/storage/keeper/keeper_test.go b/x/storage/keeper/keeper_test.go new file mode 100644 index 000000000..c55477c21 --- /dev/null +++ b/x/storage/keeper/keeper_test.go @@ -0,0 +1,66 @@ +package keeper_test + +import ( + gocontext "context" + "testing" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + storage "github.com/jackalLabs/canine-chain/x/storage" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + storagetestutil "github.com/jackalLabs/canine-chain/x/storage/testutil" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/stretchr/testify/suite" +) + +type KeeperTestSuite struct { + suite.Suite + + cdc codec.Codec + ctx sdk.Context + storageKeeper *keeper.Keeper + bankKeeper *storagetestutil.MockBankKeeper + queryClient types.QueryClient + msgSrvr types.MsgServer +} + +func (suite *KeeperTestSuite) SetupSuite() { + suite.reset() +} + +func (suite *KeeperTestSuite) reset() { + storageKeeper, bankKeeper, accountKeeper, encCfg, ctx := setupStorageKeeper(suite.T()) + + queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry) + types.RegisterQueryServer(queryHelper, storageKeeper) + queryClient := types.NewQueryClient(queryHelper) + + // TODO: make accounts in account keeper + _ = accountKeeper + + coins := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(1000000000))) + err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) + suite.NoError(err) + err = bankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, types.ModuleName, coins) + suite.NoError(err) + + suite.ctx = ctx + suite.storageKeeper = storageKeeper + suite.bankKeeper = bankKeeper + suite.cdc = encCfg.Codec + suite.queryClient = queryClient + suite.msgSrvr = keeper.NewMsgServerImpl(*suite.storageKeeper) +} + +func setupMsgServer(suite *KeeperTestSuite) (types.MsgServer, keeper.Keeper, gocontext.Context) { + k := suite.storageKeeper + storage.InitGenesis(suite.ctx, *k, *types.DefaultGenesis()) + ctx := sdk.WrapSDKContext(suite.ctx) + return keeper.NewMsgServerImpl(*k), *k, ctx +} + +func TestStorageTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} diff --git a/x/storage/keeper/msg_server.go b/x/storage/keeper/msg_server.go new file mode 100644 index 000000000..ffb1e8d50 --- /dev/null +++ b/x/storage/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} diff --git a/x/storage/keeper/msg_server_buy_storage.go b/x/storage/keeper/msg_server_buy_storage.go new file mode 100644 index 000000000..fa3146a7c --- /dev/null +++ b/x/storage/keeper/msg_server_buy_storage.go @@ -0,0 +1,67 @@ +package keeper + +import ( + "context" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerr "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func (k msgServer) BuyStorage(goCtx context.Context, msg *types.MsgBuyStorage) (*types.MsgBuyStorageResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + duration, ok := sdk.NewIntFromString(msg.Duration) + if !ok { + return nil, fmt.Errorf("duration can't be parsed") + } + + bytes, ok := sdk.NewIntFromString(msg.Bytes) + if !ok { + return nil, fmt.Errorf("bytes can't be parsed") + } + + denom := msg.PaymentDenom + if denom != "ujkl" { + return nil, sdkerr.Wrap(sdkerr.ErrInvalidCoins, "cannot pay with anything other than ujkl") + } + + var gb int64 = 1000000000 + + gbs := bytes.Int64() / gb + if gbs == 0 { + return nil, fmt.Errorf("cannot buy less than a gb") + } + + monthInBlocks := 432000 + dr := duration.Int64() - (duration.Int64() % int64(monthInBlocks)) + + if dr <= 0 { + return nil, fmt.Errorf("cannot buy less than a month") + } + + price := sdk.NewCoin(denom, sdk.NewInt(gbs*4000*(dr/int64(monthInBlocks)))) + add, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return nil, err + } + err = k.bankkeeper.SendCoinsFromAccountToModule(ctx, add, types.ModuleName, sdk.NewCoins(price)) + if err != nil { + return nil, err + } + + _, err = sdk.AccAddressFromBech32(msg.ForAddress) + if err != nil { + return nil, err + } + + err = k.CreatePayBlock(ctx, msg.ForAddress, dr, bytes.Int64()) + + if err != nil { + return nil, err + } + + return &types.MsgBuyStorageResponse{}, nil +} diff --git a/x/storage/keeper/msg_server_buy_storage_test.go b/x/storage/keeper/msg_server_buy_storage_test.go new file mode 100644 index 000000000..d775a64b9 --- /dev/null +++ b/x/storage/keeper/msg_server_buy_storage_test.go @@ -0,0 +1,111 @@ +package keeper_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func (suite *KeeperTestSuite) TestBuyStorage() { + suite.SetupSuite() + msgSrvr, _, ctx := setupMsgServer(suite) + + // Create test account + testAccount, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + coins := sdk.NewCoins(sdk.NewCoin("ujkl", sdk.NewInt(100000000))) // Send some coins to their account + err = suite.bankKeeper.SendCoinsFromModuleToAccount(suite.ctx, types.ModuleName, testAccount, coins) + suite.Require().NoError(err) + + cases := []struct { + testName string + msg types.MsgBuyStorage + expErr bool + expErrMsg string + }{ + { + testName: "buy 2gb for 1 month", + msg: types.MsgBuyStorage{ + Creator: testAccount.String(), + ForAddress: testAccount.String(), + Duration: "432000", + Bytes: "2000000000", + PaymentDenom: "ujkl", + }, + expErr: false, + expErrMsg: "", + }, + { + testName: "buy less than a gb", + msg: types.MsgBuyStorage{ + Creator: testAccount.String(), + ForAddress: testAccount.String(), + Duration: "432000", + Bytes: "12345", + PaymentDenom: "ujkl", + }, + expErr: true, + expErrMsg: "cannot buy less than a gb", + }, + { + testName: "buy less than a month", + msg: types.MsgBuyStorage{ + Creator: testAccount.String(), + ForAddress: testAccount.String(), + Duration: "431999", + Bytes: "1000000000", + PaymentDenom: "ujkl", + }, + expErr: true, + expErrMsg: "cannot buy less than a month", + }, + { + // TODO: update this when we allow alt payments + testName: "payment with uatom", + msg: types.MsgBuyStorage{ + Creator: testAccount.String(), + ForAddress: testAccount.String(), + Duration: "432000", + Bytes: "1000000000", + PaymentDenom: "uatom", + }, + expErr: true, + expErrMsg: "cannot pay with anything other than ujkl: invalid coins", + }, + { + testName: "invalid creator address", + msg: types.MsgBuyStorage{ + Creator: "invalid_address", + ForAddress: testAccount.String(), + Duration: "432000", + Bytes: "1000000000", + PaymentDenom: "ujkl", + }, + expErr: true, + expErrMsg: "decoding bech32 failed: invalid separator index -1", + }, + { + testName: "invalid for address", + msg: types.MsgBuyStorage{ + Creator: testAccount.String(), + ForAddress: "invalid_address", + Duration: "432000", + Bytes: "1000000000", + PaymentDenom: "ujkl", + }, + expErr: true, + expErrMsg: "decoding bech32 failed: invalid separator index -1", + }, + } + + for _, tc := range cases { + suite.Run(tc.testName, func() { + _, err := msgSrvr.BuyStorage(ctx, &tc.msg) + if tc.expErr { + suite.Require().EqualError(err, tc.expErrMsg) + } else { + suite.Require().NoError(err) + } + }) + } + suite.reset() +} diff --git a/x/storage/keeper/msg_server_cancel_contract.go b/x/storage/keeper/msg_server_cancel_contract.go new file mode 100644 index 000000000..49a2dfa75 --- /dev/null +++ b/x/storage/keeper/msg_server_cancel_contract.go @@ -0,0 +1,52 @@ +package keeper + +import ( + "context" + "encoding/json" + "fmt" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func (k msgServer) CancelContract(goCtx context.Context, msg *types.MsgCancelContract) (*types.MsgCancelContractResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + deal, found := k.GetActiveDeals(ctx, msg.Cid) + if !found { + return nil, fmt.Errorf("can't find contract") + } + + if deal.Creator != msg.Creator { + return nil, fmt.Errorf("you don't own this deal") + } + + ftc, found := k.GetFidCid(ctx, deal.Fid) + if !found { + return nil, sdkerrors.Wrap(sdkerrors.ErrKeyNotFound, "no fid found") + } + var ncids []string + err := json.Unmarshal([]byte(ftc.Cids), &ncids) + if err != nil { + return nil, err + } + cids := make([]string, 0) + for _, v := range ncids { + if v != msg.Cid { + cids = append(cids, v) + } + } + b, err := json.Marshal(cids) + if err != nil { + return nil, err + } + ftc.Cids = string(b) + + k.SetFidCid(ctx, ftc) + + k.RemoveActiveDeals(ctx, deal.Cid) + + return &types.MsgCancelContractResponse{}, nil +} diff --git a/x/storage/keeper/msg_server_claim_stray.go b/x/storage/keeper/msg_server_claim_stray.go new file mode 100644 index 000000000..efbfb03f4 --- /dev/null +++ b/x/storage/keeper/msg_server_claim_stray.go @@ -0,0 +1,53 @@ +package keeper + +import ( + "context" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func (k msgServer) ClaimStray(goCtx context.Context, msg *types.MsgClaimStray) (*types.MsgClaimStrayResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + stray, ok := k.GetStrays(ctx, msg.Cid) + if !ok { + return nil, sdkerrors.Wrap(sdkerrors.ErrKeyNotFound, "stray contract either no longer is stray, or has been removed by the user") + } + + ls := k.ListFiles(ctx, stray.Fid) + + provider, found := k.GetProviders(ctx, msg.Creator) + if !found { + return nil, sdkerrors.Wrap(sdkerrors.ErrKeyNotFound, "not a provider") + } + + for _, l := range ls { + if l == provider.Ip { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "cannot claim a stray you own.") + } + } + + deal := types.ActiveDeals{ + Cid: stray.Cid, + Signee: stray.Signee, + Provider: msg.Creator, + Startblock: fmt.Sprintf("%d", ctx.BlockHeight()), + Endblock: fmt.Sprintf("%d", ctx.BlockHeight()), + Filesize: stray.Filesize, + Proofverified: "false", + Blocktoprove: fmt.Sprintf("%d", ctx.BlockHeight()/1024), + Creator: msg.Creator, + Proofsmissed: "0", + Merkle: stray.Merkle, + Fid: stray.Fid, + } + + k.SetActiveDeals(ctx, deal) + + k.RemoveStrays(ctx, stray.Cid) + + return &types.MsgClaimStrayResponse{}, nil +} diff --git a/x/storage/keeper/msg_server_contracts_test.go b/x/storage/keeper/msg_server_contracts_test.go new file mode 100644 index 000000000..961a571e4 --- /dev/null +++ b/x/storage/keeper/msg_server_contracts_test.go @@ -0,0 +1,528 @@ +package keeper_test + +import ( + "encoding/json" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func (suite *KeeperTestSuite) TestPostContracts() { + suite.SetupSuite() + msgSrvr, sKeeper, goCtx := setupMsgServer(suite) + creator, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + + buyer, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + cases := []struct { + name string + preRun func() *types.MsgPostContract + postRun func() + expResp types.MsgPostContractResponse + expErr bool + expErrMsg string + }{ + { + name: "provider_doesn't_exist", + preRun: func() *types.MsgPostContract { + return &types.MsgPostContract{ + Creator: creator.String(), + Merkle: "1", + Signee: "1", + Filesize: "1", + Fid: "1", + } + }, + expErr: true, + expErrMsg: "can't find provider", + }, + + { + name: "invalid_provider_total_space_format", + preRun: func() *types.MsgPostContract { + // Set provider with invalid totalspace string + p := types.Providers{ + Address: creator.String(), + Ip: "123.0.0.0", + Totalspace: "bad_content", + BurnedContracts: "", + Creator: creator.String(), + } + sKeeper.SetProviders(suite.ctx, p) + _, found := sKeeper.GetProviders(suite.ctx, creator.String()) + suite.Require().True(found) + return &types.MsgPostContract{ + Creator: creator.String(), + Merkle: "1", + Signee: "1", + Filesize: "1", + Fid: "1", + } + }, + postRun: func() { + // fix the bad format for next tc + p, found := sKeeper.GetProviders(suite.ctx, creator.String()) + suite.Require().True(found) + p.Totalspace = "100000" + sKeeper.SetProviders(suite.ctx, p) + }, + expErr: true, + expErrMsg: "error parsing total space", + }, + + { + name: "bad_filesize_format", + preRun: func() *types.MsgPostContract { + return &types.MsgPostContract{ + Creator: creator.String(), + Merkle: "1", + Signee: "1", + Filesize: "bad_filesize", + Fid: "1", + } + }, + expErr: true, + expErrMsg: "error parsing file size", + }, + + { + name: "not_enough_provider_storage", + preRun: func() *types.MsgPostContract { + return &types.MsgPostContract{ + Creator: creator.String(), + Merkle: "1", + Signee: "1", + Filesize: "1000001", + Fid: "1", + } + }, + expErr: true, + expErrMsg: "not enough space on provider", + }, + + { + name: "not_enough_user_storage", + preRun: func() *types.MsgPostContract { + // Setup provider storag + p := types.Providers{ + Address: creator.String(), + Ip: "123.0.0.0", + Totalspace: "1000000000000000", + BurnedContracts: "", + Creator: creator.String(), + } + sKeeper.SetProviders(suite.ctx, p) + // start free two gig trial + suite.ctx = suite.ctx.WithBlockHeight(0) + err := sKeeper.CreatePayBlock(suite.ctx, buyer.String(), 1, 0) + suite.Require().NoError(err) + sKeeper.SetClientUsage(suite.ctx, types.ClientUsage{ + Usage: "1900000000", + Address: buyer.String(), + }) + return &types.MsgPostContract{ + Creator: creator.String(), + Merkle: "1", + Signee: "1", + Filesize: "20000000000", + Fid: "1", + } + }, + expErr: true, + expErrMsg: "not enough storage on the users account", + }, + + { + name: "user_didn't_pay_for_storage", + preRun: func() *types.MsgPostContract { + // Start free trial + suite.ctx = suite.ctx.WithBlockHeight(0) + err := sKeeper.CreatePayBlock(suite.ctx, buyer.String(), 100, 100000000) + suite.Require().NoError(err) + // end free trial and create "not paid" condition + suite.ctx = suite.ctx.WithBlockHeight(100) + err = sKeeper.CreatePayBlock(suite.ctx, buyer.String(), 100000, 0) + suite.Require().NoError(err) + suite.ctx = suite.ctx.WithBlockHeight(500) + goCtx = sdk.WrapSDKContext(suite.ctx) + return &types.MsgPostContract{ + Creator: creator.String(), + Merkle: "1", + Signee: buyer.String(), + Filesize: "10000", + Fid: "1", + } + }, + expErr: true, + expErrMsg: "user has not paid for any storage", + }, + + { + name: "successful_post_contract", + preRun: func() *types.MsgPostContract { + err := sKeeper.CreatePayBlock(suite.ctx, buyer.String(), 100000, 10000000000) + suite.Require().NoError(err) + return &types.MsgPostContract{ + Creator: creator.String(), + Merkle: "1", + Signee: buyer.String(), + Filesize: "10000", + Fid: "123", + } + }, + expErr: false, + }, + + { + name: "cannot_duplicate_contract", + preRun: func() *types.MsgPostContract { + return &types.MsgPostContract{ + Creator: creator.String(), + Merkle: "1", + Signee: buyer.String(), + Filesize: "10000", + Fid: "123", + } + }, + expErr: true, + expErrMsg: "cannot post the same contract twice", + }, + } + + for _, tc := range cases { + suite.Run(tc.name, func() { + // preRun must be defined to get MsgPostContract + suite.Require().NotNil(tc.preRun) + c := tc.preRun() + _, err := msgSrvr.PostContract(goCtx, c) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + } + + if tc.postRun != nil { + tc.postRun() + } + }) + } +} + +func (suite *KeeperTestSuite) TestSignContract() { + suite.SetupSuite() + msgSrvr, sKeeper, goCtx := setupMsgServer(suite) + provider, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + cases := []struct { + name string + preRun func() *types.MsgSignContract + postRun func() + expResp types.MsgSignContractResponse + expErr bool + expErrMsg string + }{ + { + name: "contract_not_found", + preRun: func() *types.MsgSignContract { + return &types.MsgSignContract{ + Cid: "contract_that_doesn't_exist", + Creator: provider.String(), + } + }, + expErr: true, + expErrMsg: "contract not found", + }, + + { + name: "invalid_permission_to_sign_contract", + preRun: func() *types.MsgSignContract { + c := types.Contracts{ + Cid: "123", + Creator: provider.String(), + Priceamt: "1", + Pricedenom: "ujkl", + Merkle: "1", + Signee: user.String(), + Duration: "10000", + Filesize: "10000", + Fid: "123", + } + sKeeper.SetContracts(suite.ctx, c) + _, found := sKeeper.GetContracts(suite.ctx, c.Cid) + suite.Require().True(found) + return &types.MsgSignContract{ + Cid: c.Cid, + Creator: "invalid_creator", + } + }, + expErr: true, + expErrMsg: "you do not have permission to approve this contract", + }, + + { + name: "successful_contract_signed", + preRun: func() *types.MsgSignContract { + return &types.MsgSignContract{ + Cid: "123", + Creator: user.String(), + } + }, + expErr: false, + }, + } + + for _, tc := range cases { + suite.Run(tc.name, func() { + // preRun must be defined to get MsgPostContract + suite.Require().NotNil(tc.preRun) + c := tc.preRun() + _, err := msgSrvr.SignContract(goCtx, c) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + } + + if tc.postRun != nil { + tc.postRun() + } + }) + } +} + +func (suite *KeeperTestSuite) TestCancelContract() { + suite.SetupSuite() + msgSrvr, sKeeper, goCtx := setupMsgServer(suite) + + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + cases := []struct { + name string + preRun func() *types.MsgCancelContract + postRun func() + expResp types.MsgCancelContractResponse + expErr bool + expErrMsg string + }{ + { + name: "active_deal_not_found", + preRun: func() *types.MsgCancelContract { + return &types.MsgCancelContract{ + Creator: user.String(), + Cid: "foo", + } + }, + expErr: true, + expErrMsg: "can't find contract", + }, + + { + name: "invalid_deal_owner", + preRun: func() *types.MsgCancelContract { + d := types.ActiveDeals{ + Cid: "100", + Creator: user.String(), + } + sKeeper.SetActiveDeals(suite.ctx, d) + _, found := sKeeper.GetActiveDeals(suite.ctx, "100") + suite.Require().True(found) + return &types.MsgCancelContract{ + Creator: "foo", + Cid: d.Cid, + } + }, + expErr: true, + expErrMsg: "you don't own this deal", + }, + + { + name: "fid_not_found", + preRun: func() *types.MsgCancelContract { + d, found := sKeeper.GetActiveDeals(suite.ctx, "100") + suite.Require().True(found) + d.Fid = "100" + sKeeper.SetActiveDeals(suite.ctx, d) + return &types.MsgCancelContract{ + Creator: user.String(), + Cid: d.Cid, + } + }, + expErr: true, + expErrMsg: "no fid found", + }, + + { + name: "invalid_cid_json", + preRun: func() *types.MsgCancelContract { + ftc := types.FidCid{ + Fid: "100", + Cids: "100", + } + sKeeper.SetFidCid(suite.ctx, ftc) + return &types.MsgCancelContract{ + Creator: user.String(), + Cid: ftc.Cids, + } + }, + expErr: true, + expErrMsg: "cannot unmarshal number into Go value of type []string", + }, + + { + name: "successfully_cancelled_contract", + preRun: func() *types.MsgCancelContract { + ncids := []string{"abc", "def", "foo", "123_bar"} + b, err := json.Marshal(ncids) + suite.Require().NoError(err) + ftc := types.FidCid{ + Fid: "100", + Cids: string(b), + } + sKeeper.SetFidCid(suite.ctx, ftc) + return &types.MsgCancelContract{ + Creator: user.String(), + Cid: "100", + } + }, + expErr: false, + }, + } + + for _, tc := range cases { + suite.Run(tc.name, func() { + // preRun must be defined to get MsgPostContract + suite.Require().NotNil(tc.preRun) + c := tc.preRun() + _, err := msgSrvr.CancelContract(goCtx, c) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + } + + if tc.postRun != nil { + tc.postRun() + } + }) + } +} + +func (suite *KeeperTestSuite) TestClaimStray() { + suite.SetupSuite() + msgSrvr, sKeeper, goCtx := setupMsgServer(suite) + provider, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + + provider2, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + cases := []struct { + name string + preRun func() *types.MsgClaimStray + postRun func() + expResp types.MsgClaimStrayResponse + expErr bool + expErrMsg string + }{ + { + name: "stray_not_found", + preRun: func() *types.MsgClaimStray { + return &types.MsgClaimStray{ + Creator: provider.String(), + Cid: "foo", + } + }, + expErr: true, + expErrMsg: "stray contract either no longer is stray, or has been removed by the user", + }, + + { + name: "not_a_provider", + preRun: func() *types.MsgClaimStray { + s := types.Strays{ + Cid: "foo", + } + sKeeper.SetStrays(suite.ctx, s) + return &types.MsgClaimStray{ + Cid: s.Cid, + Creator: provider.String(), + } + }, + expErr: true, + expErrMsg: "not a provider", + }, + + { + name: "cannot_claim_your_own_stray", + preRun: func() *types.MsgClaimStray { + s, found := sKeeper.GetStrays(suite.ctx, "foo") + suite.Require().True(found) + s.Fid = "some_fid" + sKeeper.SetStrays(suite.ctx, s) + p := types.Providers{ + Ip: "0.0.0.0", + Address: provider.String(), + Creator: provider.String(), + } + sKeeper.SetProviders(suite.ctx, p) + ad := types.ActiveDeals{ + Fid: s.Fid, + Provider: p.Address, + } + sKeeper.SetActiveDeals(suite.ctx, ad) + return &types.MsgClaimStray{ + Cid: s.Cid, + Creator: provider.String(), + } + }, + expErr: true, + expErrMsg: "cannot claim a stray you own.", + }, + + { + name: "successfully_claimed_stray", + preRun: func() *types.MsgClaimStray { + p := types.Providers{ + Ip: "123.0.0.0", + Address: provider2.String(), + Creator: provider.String(), + } + sKeeper.SetProviders(suite.ctx, p) + return &types.MsgClaimStray{ + Cid: "foo", + Creator: provider2.String(), + } + }, + expErr: false, + }, + } + + for _, tc := range cases { + suite.Run(tc.name, func() { + // preRun must be defined to get MsgPostContract + suite.Require().NotNil(tc.preRun) + c := tc.preRun() + _, err := msgSrvr.ClaimStray(goCtx, c) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + } + + if tc.postRun != nil { + tc.postRun() + } + }) + } +} diff --git a/x/storage/keeper/msg_server_init_provider.go b/x/storage/keeper/msg_server_init_provider.go new file mode 100644 index 000000000..d3b12fbc2 --- /dev/null +++ b/x/storage/keeper/msg_server_init_provider.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func (k msgServer) InitProvider(goCtx context.Context, msg *types.MsgInitProvider) (*types.MsgInitProviderResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + provider := types.Providers{ + Address: msg.Creator, + Ip: msg.Ip, + Totalspace: msg.Totalspace, + Creator: msg.Creator, + BurnedContracts: "0", + } + + k.SetProviders(ctx, provider) + + return &types.MsgInitProviderResponse{}, nil +} diff --git a/x/storage/keeper/msg_server_post_contract.go b/x/storage/keeper/msg_server_post_contract.go new file mode 100644 index 000000000..63022525c --- /dev/null +++ b/x/storage/keeper/msg_server_post_contract.go @@ -0,0 +1,93 @@ +package keeper + +import ( + "context" + "crypto/sha256" + "fmt" + "io" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func (k msgServer) PostContract(goCtx context.Context, msg *types.MsgPostContract) (*types.MsgPostContractResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + provider, ok := k.GetProviders(ctx, msg.Creator) + if !ok { + return nil, fmt.Errorf("can't find provider") + } + + ts, ok := sdk.NewIntFromString(provider.Totalspace) + + if !ok { + return nil, fmt.Errorf("error parsing total space") + } + + fs, ok := sdk.NewIntFromString(msg.Filesize) + + if !ok { + return nil, fmt.Errorf("error parsing file size") + } + + if k.GetProviderUsing(ctx, msg.Creator)+fs.Int64() > ts.Int64() { + return nil, fmt.Errorf("not enough space on provider") + } + + paidAMT, _, _ := k.GetPaidAmount(ctx, msg.Signee, ctx.BlockHeight()) + + if paidAMT <= 0 { + return nil, fmt.Errorf("user has not paid for any storage") + } + + usage, found := k.GetClientUsage(ctx, msg.Signee) + if !found { + usage = types.ClientUsage{ + Usage: "0", + Address: msg.Signee, + } + } + + bytesUsed, ok := sdk.NewIntFromString(usage.Usage) + if !ok { + return nil, fmt.Errorf("failed to parse usage") + } + + filesize, ok := sdk.NewIntFromString(msg.Filesize) + if !ok { + return nil, fmt.Errorf("cannot parse filesize") + } + + if bytesUsed.Int64()+filesize.Int64() > paidAMT { + return nil, fmt.Errorf("not enough storage on the users account") + } + + h := sha256.New() + _, err := io.WriteString(h, fmt.Sprintf("%s%s%s", msg.Signee, msg.Creator, msg.Fid)) + if err != nil { + return nil, err + } + hashName := h.Sum(nil) + + cid := fmt.Sprintf("%x", hashName) + + _, cidtaken := k.GetContracts(ctx, cid) + if cidtaken { + return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "cannot post the same contract twice") + } + + newContract := types.Contracts{ + Cid: cid, + Signee: msg.Signee, + Fid: msg.Fid, + Filesize: msg.Filesize, + Creator: msg.Creator, + Merkle: msg.Merkle, + } + + k.SetContracts(ctx, newContract) + + return &types.MsgPostContractResponse{}, nil +} diff --git a/x/storage/keeper/msg_server_postproof.go b/x/storage/keeper/msg_server_postproof.go new file mode 100644 index 000000000..a53637a30 --- /dev/null +++ b/x/storage/keeper/msg_server_postproof.go @@ -0,0 +1,94 @@ +package keeper + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "strings" + + // sdk "github.com/cosmos/cosmos-sdk/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + merkletree "github.com/wealdtech/go-merkletree" + + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func printProof(ctx sdk.Context, proof merkletree.Proof) { + ctx.Logger().Info("Hashes: %v\nIndex: %d\n", proof.Hashes, proof.Index) +} + +func (k msgServer) Postproof(goCtx context.Context, msg *types.MsgPostproof) (*types.MsgPostproofResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + hashes := strings.Split(msg.Hashlist, ",") + + contract, found := k.GetActiveDeals(ctx, msg.Cid) + if !found { + ctx.Logger().Debug("%s, %s\n", "Contract not found", msg.Cid) + + return nil, fmt.Errorf("contract not found") + } + + if contract.Proofverified == "true" { + return nil, fmt.Errorf("proof already verified") + } + + ctx.Logger().Debug("Contract that was found: \n%v\n", contract) + + nn, ok := sdk.NewIntFromString(contract.Blocktoprove) + if !ok { + return nil, fmt.Errorf("failed to parse block") + } + num := nn.Int64() + + h := sha256.New() + _, err := io.WriteString(h, fmt.Sprintf("%d%s", num, msg.Item)) + if err != nil { + return nil, err + } + hashName := h.Sum(nil) + + ctx.Logger().Debug("%v\n", hashes) + + var proof merkletree.Proof + + err = json.Unmarshal([]byte(msg.Hashlist), &proof) + if err != nil { + ctx.Logger().Debug("%v\n", err) + return nil, err + } + + ctx.Logger().Debug("proof: %v\n", proof) + printProof(ctx, proof) + + m, err := hex.DecodeString(contract.Merkle) + if err != nil { + ctx.Logger().Error("%v\n", err) + return nil, fmt.Errorf("could not build merkle tree") + } + verified, err := merkletree.VerifyProof(hashName, &proof, m) + if err != nil { + ctx.Logger().Error("%v\n", err) + + return nil, fmt.Errorf("could not build merkle tree") + } + + if !verified { + ctx.Logger().Debug("%s\n", "Cannot verify") + + return nil, fmt.Errorf("file chunk was not verified") + } + + if contract.Proofverified == "false" { + ctx.GasMeter().RefundGas(ctx.GasMeter().GasConsumed(), "successful proof refund.") + } + + contract.Proofverified = "true" + k.SetActiveDeals(ctx, contract) + + return &types.MsgPostproofResponse{Merkle: fmt.Sprintf("%v", proof)}, nil +} diff --git a/x/storage/keeper/msg_server_proofs_test.go b/x/storage/keeper/msg_server_proofs_test.go new file mode 100644 index 000000000..629867f4e --- /dev/null +++ b/x/storage/keeper/msg_server_proofs_test.go @@ -0,0 +1,272 @@ +package keeper_test + +import ( + "crypto/sha256" + "encoding/hex" + "encoding/json" + "fmt" + "io" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" + merkletree "github.com/wealdtech/go-merkletree" +) + +type TestFile struct { + Name string + Data string +} + +var originalFile = TestFile{ + Name: "jackal_file", + Data: "jackal maxi", +} + +var fileFromSP = TestFile{ + Name: "jackal_file", + Data: "jackal maxi", +} + +var randomFile = TestFile{ + Name: "random_file", + Data: "hello world", +} + +const ( + CID = "6ef1cf960c0b1e257049645ff13ed890c2d4ef69c62165bf4e090ec480770d67" + CID2 = "a257645c433288e20c23d4fc8ce823c66558e5398c98b140d7ccfb39e8a3c70e" +) + +func CreateMerkleForProof(file TestFile) (string, string, error) { + f := []byte(file.Data) + index := 0 + var data [][]byte + item := f + + h := sha256.New() + _, err := io.WriteString(h, fmt.Sprintf("%d%x", index, f)) + if err != nil { + return "", "", err + } + hashName := h.Sum(nil) + + data = append(data, hashName) + + tree, err := merkletree.New(data) + if err != nil { + return "", "", err + } + + h = sha256.New() + _, err = io.WriteString(h, fmt.Sprintf("%d%x", index, item)) + if err != nil { + return "", "", err + } + ditem := h.Sum(nil) + + proof, err := tree.GenerateProof(ditem) + if err != nil { + return "", "", err + } + + jproof, err := json.Marshal(*proof) + if err != nil { + return "", "", err + } + + e := hex.EncodeToString(tree.Root()) + + k, _ := hex.DecodeString(e) + + verified, err := merkletree.VerifyProof(ditem, proof, k) + if err != nil { + fmt.Printf("%v\n", err) + } + + if !verified { + fmt.Printf("%s\n", "Cannot verify") + } + + return fmt.Sprintf("%x", item), string(jproof), nil +} + +func makeContract(file TestFile) (string, string, error) { + f := []byte(file.Data) + size := 0 + var list [][]byte + + size += len(f) + + h := sha256.New() + _, err := io.WriteString(h, fmt.Sprintf("%d%x", 0, f)) + if err != nil { + return "", "", err + } + hashName := h.Sum(nil) + + list = append(list, hashName) + + t, err := merkletree.New(list) + if err != nil { + fmt.Printf("%v\n", err) + } + + return hex.EncodeToString(t.Root()), fmt.Sprintf("%d", size), nil +} + +func (suite *KeeperTestSuite) TestPostProof() { + suite.SetupSuite() + + msgSrvr, keeper, context := setupMsgServer(suite) + + // Create user account + user, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + + // Create provider account + testProvider, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + // Init Provider + _, err = msgSrvr.InitProvider(context, &types.MsgInitProvider{ + Creator: testProvider.String(), + Ip: "198.0.0.1", + Totalspace: "1_000_000", + }) + suite.Require().NoError(err) + + // Storage Provider receives file and make merkleroot for contract + merkleroot, filesize, err := makeContract(originalFile) + suite.Require().NoError(err) + + // Post Contract + _, err = msgSrvr.PostContract(context, &types.MsgPostContract{ + Creator: testProvider.String(), + Signee: user.String(), + Filesize: filesize, + Fid: "fid", + Merkle: merkleroot, + }) + suite.Require().NoError(err) + + // Post Contract #2 + _, err = msgSrvr.PostContract(context, &types.MsgPostContract{ + Creator: testProvider.String(), + Signee: user.String(), + Filesize: "1000", + Fid: "fid2", + Merkle: "invalid_merkleroot", + }) + suite.Require().NoError(err) + + // Sign Contract for active deal + _, err = msgSrvr.SignContract(context, &types.MsgSignContract{ + Creator: user.String(), + Cid: CID, + }) + suite.Require().NoError(err) + + // Sign Contract #2 for active deal + _, err = msgSrvr.SignContract(context, &types.MsgSignContract{ + Creator: user.String(), + Cid: CID2, + }) + suite.Require().NoError(err) + + // Storage Provider get file and create merkle for proof + // for tc 1 and 2 + item, hashlist, err := CreateMerkleForProof(fileFromSP) + suite.Require().NoError(err) + + // for tc 3: post proof from a different file + item2, hashlist2, err2 := CreateMerkleForProof(randomFile) + suite.Require().NoError(err2) + + cases := []struct { + testName string + msg types.MsgPostproof + expErr bool + expErrMsg string + postRun func() + }{ + { + testName: "proof successfully verified", + msg: types.MsgPostproof{ + Creator: testProvider.String(), + Cid: CID, + Item: item, + Hashlist: hashlist, + }, + expErr: false, + expErrMsg: "", + }, + { + testName: "postproof for the same file again", + msg: types.MsgPostproof{ + Creator: testProvider.String(), + Cid: CID, + Item: item, + Hashlist: hashlist, + }, + expErr: true, + expErrMsg: "proof already verified", + postRun: func() { + // Set Proofverified back to false + contract, _ := keeper.GetActiveDeals(suite.ctx, CID) + contract.Proofverified = "false" + keeper.SetActiveDeals(suite.ctx, contract) + }, + }, + { + testName: "proof fail to verify", + msg: types.MsgPostproof{ + Creator: testProvider.String(), + Cid: CID, + Item: item2, + Hashlist: hashlist2, + }, + expErr: true, + expErrMsg: "file chunk was not verified", + }, + { + testName: "nonexisting contract", + msg: types.MsgPostproof{ + Creator: testProvider.String(), + Cid: "fakecontractid", + Item: item, + Hashlist: hashlist, + }, + expErr: true, + expErrMsg: "contract not found", + }, + { + testName: "contract with invalid merkleroot", + msg: types.MsgPostproof{ + Creator: testProvider.String(), + Cid: CID2, + Item: item2, + Hashlist: hashlist2, + }, + expErr: true, + expErrMsg: "could not build merkle tree", + }, + } + + for _, tc := range cases { + suite.Run( + tc.testName, func() { + _, err := msgSrvr.Postproof(context, &tc.msg) + if tc.expErr { + suite.Require().EqualError(err, tc.expErrMsg) + } else { + contract, _ := keeper.GetActiveDeals(suite.ctx, CID) + suite.Require().Equal("true", contract.Proofverified) + suite.Require().NoError(err) + } + if tc.postRun != nil { + tc.postRun() + } + }, + ) + } +} diff --git a/x/storage/keeper/msg_server_providers_test.go b/x/storage/keeper/msg_server_providers_test.go new file mode 100644 index 000000000..8ecb3035a --- /dev/null +++ b/x/storage/keeper/msg_server_providers_test.go @@ -0,0 +1,191 @@ +package keeper_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// testing msg server files for: init_provider, set_provider_ip, set_provider_totalspace + +func (suite *KeeperTestSuite) TestMsgInitProvider() { + suite.SetupSuite() + + msgSrvr, _, context := setupMsgServer(suite) + + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + cases := []struct { + preRun func() *types.MsgInitProvider + expErr bool + expErrMsg string + name string + }{ + { + preRun: func() *types.MsgInitProvider { + return types.NewMsgInitProvider( + user.String(), + "127.0.0.1", + "1000000000", + ) + }, + expErr: false, + name: "init provider success", + }, + } + + for _, tc := range cases { + suite.Run(tc.name, func() { + msg := tc.preRun() + suite.Require().NoError(err) + res, err := msgSrvr.InitProvider(context, msg) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + suite.Require().EqualValues(types.MsgInitProviderResponse{}, *res) + + } + }) + } +} + +func (suite *KeeperTestSuite) TestMsgSetProviderIP() { + suite.SetupSuite() + + msgSrvr, _, context := setupMsgServer(suite) + + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + provider := types.Providers{ + Address: user.String(), + Ip: "", + Totalspace: "1000000", + Creator: user.String(), + BurnedContracts: "0", + } + + suite.storageKeeper.SetProviders(suite.ctx, provider) + + cases := []struct { + preRun func() *types.MsgSetProviderIP + expErr bool + expErrMsg string + name string + }{ + { + preRun: func() *types.MsgSetProviderIP { + return types.NewMsgSetProviderIP( + user.String(), + "127.0.0.1", + ) + }, + expErr: false, + name: "set provider ip success", + }, + { + preRun: func() *types.MsgSetProviderIP { + return types.NewMsgSetProviderIP( + "wrong address", + "127.0.0.1", + ) + }, + expErr: true, + expErrMsg: "Provider not found. Please init your provider.", + name: "set provider ip fail", + }, + } + + for _, tc := range cases { + suite.Run(tc.name, func() { + msg := tc.preRun() + suite.Require().NoError(err) + res, err := msgSrvr.SetProviderIP(context, msg) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + suite.Require().EqualValues(types.MsgSetProviderIPResponse{}, *res) + + } + }) + } +} + +func (suite *KeeperTestSuite) TestMsgSetProviderTotalSpace() { + suite.SetupSuite() + + msgSrvr, _, context := setupMsgServer(suite) + + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + provider := types.Providers{ + Address: user.String(), + Ip: "127.0.0.1", + Totalspace: "", + Creator: user.String(), + BurnedContracts: "0", + } + + suite.storageKeeper.SetProviders(suite.ctx, provider) + + cases := []struct { + preRun func() *types.MsgSetProviderTotalspace + expErr bool + expErrMsg string + name string + }{ + { + preRun: func() *types.MsgSetProviderTotalspace { + return types.NewMsgSetProviderTotalspace( + user.String(), + "1000000", + ) + }, + expErr: false, + name: "set provider total space success", + }, + { + preRun: func() *types.MsgSetProviderTotalspace { + return types.NewMsgSetProviderTotalspace( + "wrong address", + "1000000", + ) + }, + expErr: true, + expErrMsg: "Provider not found. Please init your provider.", + name: "set provider total space fail", + }, + { + preRun: func() *types.MsgSetProviderTotalspace { + return types.NewMsgSetProviderTotalspace( + user.String(), + "9@!0", + ) + }, + expErr: true, + expErrMsg: "Not a valid total space. Please enter total number of bytes to provide.", + name: "invalid space param", + }, + } + + for _, tc := range cases { + suite.Run(tc.name, func() { + msg := tc.preRun() + suite.Require().NoError(err) + res, err := msgSrvr.SetProviderTotalspace(context, msg) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + suite.Require().EqualValues(types.MsgSetProviderIPResponse{}, *res) + + } + }) + } +} diff --git a/x/storage/keeper/msg_server_set_provider_ip.go b/x/storage/keeper/msg_server_set_provider_ip.go new file mode 100644 index 000000000..9de2cf80e --- /dev/null +++ b/x/storage/keeper/msg_server_set_provider_ip.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func (k msgServer) SetProviderIP(goCtx context.Context, msg *types.MsgSetProviderIP) (*types.MsgSetProviderIPResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + provider, found := k.GetProviders(ctx, msg.Creator) + + if !found { + return nil, types.ErrProviderNotFound + } + + provider.Ip = msg.Ip + + k.SetProviders(ctx, provider) + + return &types.MsgSetProviderIPResponse{}, nil +} diff --git a/x/storage/keeper/msg_server_set_provider_totalspace.go b/x/storage/keeper/msg_server_set_provider_totalspace.go new file mode 100644 index 000000000..1429e406e --- /dev/null +++ b/x/storage/keeper/msg_server_set_provider_totalspace.go @@ -0,0 +1,40 @@ +package keeper + +import ( + "context" + "strconv" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func (k msgServer) SetProviderTotalspace(goCtx context.Context, msg *types.MsgSetProviderTotalspace) (*types.MsgSetProviderTotalspaceResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + provider, found := k.GetProviders(ctx, msg.Creator) + + if !found { + return nil, types.ErrProviderNotFound + } + + validTotalSpace := isValidTotalSpace(msg.Space) + + if !validTotalSpace { + return nil, types.ErrNotValidTotalSpace + } + + provider.Totalspace = msg.Space + + k.SetProviders(ctx, provider) + + return &types.MsgSetProviderTotalspaceResponse{}, nil +} + +func isValidTotalSpace(totalSpace string) bool { + var isNumber bool + + if _, err := strconv.Atoi(totalSpace); err == nil { + isNumber = true + } + return isNumber +} diff --git a/x/storage/keeper/msg_server_sign_contract.go b/x/storage/keeper/msg_server_sign_contract.go new file mode 100644 index 000000000..1c5679a51 --- /dev/null +++ b/x/storage/keeper/msg_server_sign_contract.go @@ -0,0 +1,116 @@ +package keeper + +import ( + "context" + "crypto/sha256" + "encoding/json" + "fmt" + "io" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func (k msgServer) SignContract(goCtx context.Context, msg *types.MsgSignContract) (*types.MsgSignContractResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + contract, found := k.GetContracts(ctx, msg.Cid) + if !found { + return nil, fmt.Errorf("contract not found") + } + + if contract.Signee != msg.Creator { + return nil, fmt.Errorf("you do not have permission to approve this contract") + } + + deal := types.ActiveDeals{ + Cid: contract.Cid, + Signee: contract.Signee, + Provider: contract.Creator, + Startblock: fmt.Sprintf("%d", ctx.BlockHeight()), + Endblock: fmt.Sprintf("%d", ctx.BlockHeight()), + Filesize: contract.Filesize, + Proofverified: "false", + Blocktoprove: fmt.Sprintf("%d", ctx.BlockHeight()/1024), + Creator: msg.Creator, + Proofsmissed: "0", + Merkle: contract.Merkle, + Fid: contract.Fid, + } + + usage, found := k.GetClientUsage(ctx, msg.Creator) + if !found { + usage = types.ClientUsage{ + Address: msg.Creator, + Usage: "0", + } + } + + size, ok := sdk.NewIntFromString(contract.Filesize) + if !ok { + return nil, fmt.Errorf("cannot parse filesize") + } + + used, ok := sdk.NewIntFromString(usage.Usage) + if !ok { + return nil, fmt.Errorf("cannot parse usage") + } + + usage.Usage = fmt.Sprintf("%d", used.Int64()+size.Int64()) + + k.SetClientUsage(ctx, usage) + k.SetActiveDeals(ctx, deal) + k.RemoveContracts(ctx, contract.Cid) + + ftc, found := k.GetFidCid(ctx, contract.Fid) + + cids := []string{contract.Cid} + + if found { + var ncids []string + err := json.Unmarshal([]byte(ftc.Cids), &ncids) + if err != nil { + return nil, err + } + + cids = append(cids, ncids...) + } + + for i := 0; i < 2; i++ { + h := sha256.New() + _, err := io.WriteString(h, fmt.Sprintf("%s%s%d", contract.Creator, contract.Fid, i)) + if err != nil { + return nil, err + } + hashName := h.Sum(nil) + + scid := fmt.Sprintf("%x", hashName) + + newContract := types.Strays{ + Cid: scid, + Signee: contract.Signee, + Fid: contract.Fid, + Filesize: contract.Filesize, + Merkle: contract.Merkle, + } + + cids = append(cids, scid) + + k.SetStrays(ctx, newContract) + + } + + cidarr, err := json.Marshal(cids) + if err != nil { + return nil, err + } + + nftc := types.FidCid{ + Fid: contract.Fid, + Cids: string(cidarr), + } + + k.SetFidCid(ctx, nftc) + + return &types.MsgSignContractResponse{}, nil +} diff --git a/x/storage/keeper/params.go b/x/storage/keeper/params.go new file mode 100644 index 000000000..92d474a38 --- /dev/null +++ b/x/storage/keeper/params.go @@ -0,0 +1,16 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// GetParams get all parameters as types.Params +func (k Keeper) GetParams(ctx sdk.Context) types.Params { + return types.NewParams() +} + +// SetParams set the params +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + k.paramstore.SetParamSet(ctx, ¶ms) +} diff --git a/x/storage/keeper/pay_blocks.go b/x/storage/keeper/pay_blocks.go new file mode 100644 index 000000000..4ab8d903f --- /dev/null +++ b/x/storage/keeper/pay_blocks.go @@ -0,0 +1,61 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// SetPayBlocks set a specific payBlocks in the store from its index +func (k Keeper) SetPayBlocks(ctx sdk.Context, payBlocks types.PayBlocks) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PayBlocksKeyPrefix)) + b := k.cdc.MustMarshal(&payBlocks) + store.Set(types.PayBlocksKey( + payBlocks.Blockid, + ), b) +} + +// GetPayBlocks returns a payBlocks from its index +func (k Keeper) GetPayBlocks( + ctx sdk.Context, + blockid string, +) (val types.PayBlocks, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PayBlocksKeyPrefix)) + + b := store.Get(types.PayBlocksKey( + blockid, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemovePayBlocks removes a payBlocks from the store +func (k Keeper) RemovePayBlocks( + ctx sdk.Context, + blockid string, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PayBlocksKeyPrefix)) + store.Delete(types.PayBlocksKey( + blockid, + )) +} + +// GetAllPayBlocks returns all payBlocks +func (k Keeper) GetAllPayBlocks(ctx sdk.Context) (list []types.PayBlocks) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PayBlocksKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.PayBlocks + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/storage/keeper/pay_blocks_test.go b/x/storage/keeper/pay_blocks_test.go new file mode 100644 index 000000000..42af1d4b8 --- /dev/null +++ b/x/storage/keeper/pay_blocks_test.go @@ -0,0 +1,59 @@ +package keeper_test + +import ( + "strconv" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createPayBlocks(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.PayBlocks { + items := make([]types.PayBlocks, n) + for i := range items { + items[i].Blockid = strconv.Itoa(i) + items[i].Bytes = strconv.Itoa(i) + items[i].Blocktype = strconv.Itoa(i) + items[i].Blocknum = strconv.Itoa(i) + + keeper.SetPayBlocks(ctx, items[i]) + } + return items +} + +func (suite *KeeperTestSuite) TestGetPayBlocks() { + k := suite.storageKeeper + ctx := suite.ctx + + items := createPayBlocks(k, ctx, 10) + for _, item := range items { + rst, found := k.GetPayBlocks(ctx, item.Blockid) + suite.Require().True(found) + suite.Equal(item, rst) + } +} + +func (suite *KeeperTestSuite) TestRemovePayBlocks() { + k := suite.storageKeeper + ctx := suite.ctx + + items := createPayBlocks(k, ctx, 10) + for _, item := range items { + k.RemovePayBlocks(ctx, item.Blockid) + + rst, found := k.GetPayBlocks(ctx, item.Blockid) + suite.Require().Empty(rst) + suite.Require().False(found) + } +} + +func (suite *KeeperTestSuite) TestGetAllPayBlocks() { + k := suite.storageKeeper + ctx := suite.ctx + + items := createPayBlocks(k, ctx, 10) + suite.Require().Equal(items, k.GetAllPayBlocks(ctx)) +} diff --git a/x/storage/keeper/proofs.go b/x/storage/keeper/proofs.go new file mode 100644 index 000000000..4605ab234 --- /dev/null +++ b/x/storage/keeper/proofs.go @@ -0,0 +1,61 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// SetProofs set a specific proofs in the store from its index +func (k Keeper) SetProofs(ctx sdk.Context, proofs types.Proofs) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ProofsKeyPrefix)) + b := k.cdc.MustMarshal(&proofs) + store.Set(types.ProofsKey( + proofs.Cid, + ), b) +} + +// GetProofs returns a proofs from its index +func (k Keeper) GetProofs( + ctx sdk.Context, + cid string, +) (val types.Proofs, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ProofsKeyPrefix)) + + b := store.Get(types.ProofsKey( + cid, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveProofs removes a proofs from the store +func (k Keeper) RemoveProofs( + ctx sdk.Context, + cid string, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ProofsKeyPrefix)) + store.Delete(types.ProofsKey( + cid, + )) +} + +// GetAllProofs returns all proofs +func (k Keeper) GetAllProofs(ctx sdk.Context) (list []types.Proofs) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ProofsKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Proofs + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/storage/keeper/providers.go b/x/storage/keeper/providers.go new file mode 100644 index 000000000..96516953c --- /dev/null +++ b/x/storage/keeper/providers.go @@ -0,0 +1,61 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// SetProviders set a specific providers in the store from its index +func (k Keeper) SetProviders(ctx sdk.Context, providers types.Providers) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ProvidersKeyPrefix)) + b := k.cdc.MustMarshal(&providers) + store.Set(types.ProvidersKey( + providers.Address, + ), b) +} + +// GetProviders returns a providers from its index +func (k Keeper) GetProviders( + ctx sdk.Context, + address string, +) (val types.Providers, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ProvidersKeyPrefix)) + + b := store.Get(types.ProvidersKey( + address, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveProviders removes a providers from the store +func (k Keeper) RemoveProviders( + ctx sdk.Context, + address string, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ProvidersKeyPrefix)) + store.Delete(types.ProvidersKey( + address, + )) +} + +// GetAllProviders returns all providers +func (k Keeper) GetAllProviders(ctx sdk.Context) (list []types.Providers) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ProvidersKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Providers + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/storage/keeper/providers_test.go b/x/storage/keeper/providers_test.go new file mode 100644 index 000000000..76f32d08c --- /dev/null +++ b/x/storage/keeper/providers_test.go @@ -0,0 +1,144 @@ +package keeper_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// testing providers.go file +func (suite *KeeperTestSuite) TestSetProviders() { + suite.SetupSuite() + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + provider := types.Providers{ + Address: user.String(), + Ip: "192.158.1.38", + Totalspace: "9000", + BurnedContracts: "0", + Creator: user.String(), + } + + suite.storageKeeper.SetProviders(suite.ctx, provider) + suite.Require().NoError(err) + + providerRequest := types.QueryGetProvidersRequest{ + Address: user.String(), + } + + res, err := suite.queryClient.Providers(suite.ctx.Context(), &providerRequest) + suite.Require().NoError(err) + suite.Require().Equal(res.Providers.Address, provider.Address) + suite.Require().Equal(res.Providers.Ip, provider.Ip) + suite.Require().Equal(res.Providers.Totalspace, provider.Totalspace) + suite.Require().Equal(res.Providers.BurnedContracts, provider.BurnedContracts) + suite.Require().Equal(res.Providers.Creator, provider.Creator) +} + +func (suite *KeeperTestSuite) TestGetProviders() { + suite.SetupSuite() + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + provider := types.Providers{ + Address: user.String(), + Ip: "192.158.1.38", + Totalspace: "9000", + BurnedContracts: "0", + Creator: user.String(), + } + + suite.storageKeeper.SetProviders(suite.ctx, provider) + suite.Require().NoError(err) + + foundProvider, found := suite.storageKeeper.GetProviders(suite.ctx, user.String()) + suite.Require().NoError(err) + suite.Require().Equal(found, true) + suite.Require().Equal(foundProvider.Address, provider.Address) + suite.Require().Equal(foundProvider.Ip, provider.Ip) + suite.Require().Equal(foundProvider.Totalspace, provider.Totalspace) + suite.Require().Equal(foundProvider.BurnedContracts, provider.BurnedContracts) + suite.Require().Equal(foundProvider.Creator, provider.Creator) +} + +func (suite *KeeperTestSuite) TestGetAllProviders() { + suite.SetupSuite() + alice, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + bob, err := sdk.AccAddressFromBech32("cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl") + suite.Require().NoError(err) + + provider := types.Providers{ + Address: alice.String(), + Ip: "192.158.1.38", + Totalspace: "9000", + BurnedContracts: "0", + Creator: alice.String(), + } + + suite.storageKeeper.SetProviders(suite.ctx, provider) + suite.Require().NoError(err) + + provider1 := types.Providers{ + Address: bob.String(), + Ip: "127.159.2.39", + Totalspace: "18000", + BurnedContracts: "0", + Creator: bob.String(), + } + + suite.storageKeeper.SetProviders(suite.ctx, provider1) + suite.Require().NoError(err) + + allProviders := suite.storageKeeper.GetAllProviders(suite.ctx) + suite.Require().NoError(err) + + providerAlice := allProviders[1] + suite.Require().Equal(providerAlice.Address, provider.Address) + suite.Require().Equal(providerAlice.Ip, provider.Ip) + suite.Require().Equal(providerAlice.Totalspace, provider.Totalspace) + suite.Require().Equal(providerAlice.BurnedContracts, provider.BurnedContracts) + suite.Require().Equal(providerAlice.Creator, provider.Creator) + + providerBob := allProviders[0] + suite.Require().Equal(providerBob.Address, provider1.Address) + suite.Require().Equal(providerBob.Ip, provider1.Ip) + suite.Require().Equal(providerBob.Totalspace, provider1.Totalspace) + suite.Require().Equal(providerBob.BurnedContracts, provider1.BurnedContracts) + suite.Require().Equal(providerBob.Creator, provider1.Creator) +} + +func (suite *KeeperTestSuite) TestRemoveProviders() { + suite.SetupSuite() + user, err := sdk.AccAddressFromBech32("cosmos1ytwr7x4av05ek0tf8z9s4zmvr6w569zsm27dpg") + suite.Require().NoError(err) + + provider := types.Providers{ + Address: user.String(), + Ip: "192.158.1.38", + Totalspace: "9000", + BurnedContracts: "0", + Creator: user.String(), + } + + suite.storageKeeper.SetProviders(suite.ctx, provider) + suite.Require().NoError(err) + + suite.storageKeeper.RemoveProviders(suite.ctx, user.String()) + suite.Require().NoError(err) + + foundProvider, found := suite.storageKeeper.GetProviders(suite.ctx, user.String()) + suite.Require().NoError(err) + suite.Require().Equal(found, false) + + ghostProvider := types.Providers{ + Address: "", + Ip: "", + Totalspace: "", + BurnedContracts: "", + Creator: "", + } + + suite.Require().Equal(foundProvider, ghostProvider) +} diff --git a/x/storage/keeper/rewards.go b/x/storage/keeper/rewards.go new file mode 100644 index 000000000..d7324dc20 --- /dev/null +++ b/x/storage/keeper/rewards.go @@ -0,0 +1,202 @@ +package keeper + +import ( + "fmt" + "strconv" + + sdk "github.com/cosmos/cosmos-sdk/types" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func (k Keeper) HandleBlock(ctx sdk.Context) { + allDeals := k.GetAllActiveDeals(ctx) + + height := ctx.BlockHeight() + + const fchunks int64 = 1024 + + var dayBlocks int64 = 10 * 5 // 10 blocks is about 1 minute + + ctx.Logger().Debug("blockdiff : %d\n", height%dayBlocks) + if height%dayBlocks == 0 { + ctx.Logger().Debug("%s\n", "checking blocks") + + var networkSize int64 + for i := 0; i < len(allDeals); i++ { + deal := allDeals[i] + ss, ok := sdk.NewIntFromString(deal.Filesize) + if !ok { + continue + } + networkSize += ss.Int64() + } + + address := k.accountkeeper.GetModuleAddress(types.ModuleName) + balance := k.bankkeeper.GetBalance(ctx, address, "ujkl") + + for i := 0; i < len(allDeals); i++ { + deal := allDeals[i] + + toprove, ok := sdk.NewIntFromString(deal.Blocktoprove) + if !ok { + ctx.Logger().Debug("Int Parse Failed!\n") + continue + } + + iprove := toprove.Int64() + + totalSize, ok := sdk.NewIntFromString(deal.Filesize) + if !ok { + ctx.Logger().Debug("Int Parse Failed!\n") + continue + } + + byteHash := ctx.HeaderHash().Bytes()[0] + ctx.HeaderHash().Bytes()[1] + ctx.HeaderHash().Bytes()[2] + + d := totalSize.Int64() / fchunks + + if d > 0 { + iprove = (iprove + ctx.BlockHeight()*int64(byteHash)) % d + } + + deal.Blocktoprove = fmt.Sprintf("%d", iprove) + + verified, errb := strconv.ParseBool(deal.Proofverified) + + if errb != nil { + ctx.Logger().Debug("ERR %v\n", errb) + continue + } + + if !verified { + ctx.Logger().Debug("%s\n", "Not verified!") + intt, ok := sdk.NewIntFromString(deal.Proofsmissed) + if !ok { + ctx.Logger().Debug("Int Parse Failed!\n") + continue + } + + sb, ok := sdk.NewIntFromString(deal.Startblock) + if !ok { + ctx.Logger().Debug("Int Parse Failed!\n") + continue + } + + if sb.Int64() >= height-dayBlocks { + continue + } + + misses := intt.Int64() + 1 + const missesToBurn int64 = 3 + + if misses > missesToBurn { + provider, ok := k.GetProviders(ctx, deal.Provider) + if !ok { + continue + } + + curburn, ok := sdk.NewIntFromString(provider.BurnedContracts) + if !ok { + continue + } + provider.BurnedContracts = fmt.Sprintf("%d", curburn.Int64()+1) + k.SetProviders(ctx, provider) + + // Creating new stray file from the burned active deal + strayDeal := types.Strays{ + Cid: deal.Cid, + Fid: deal.Fid, + Signee: deal.Signee, + Filesize: deal.Filesize, + Merkle: deal.Merkle, + } + k.SetStrays(ctx, strayDeal) + k.RemoveActiveDeals(ctx, deal.Cid) + continue + } + + deal.Proofsmissed = fmt.Sprintf("%d", misses) + k.SetActiveDeals(ctx, deal) + continue + } + + sizeint, ok := sdk.NewIntFromString(deal.Filesize) + if !ok { + ctx.Logger().Error("Cannot parse filesize as int") + continue + } + + ctx.Logger().Debug(fmt.Sprintf("File size: %s\n", deal.Filesize)) + ctx.Logger().Debug(fmt.Sprintf("Total size: %d\n", networkSize)) + + sid := sdk.NewDec(sizeint.Int64()) + ts := sdk.NewDec(networkSize) + + siv, err := sid.Float64() + if err != nil { + ctx.Logger().Error(err.Error()) + continue + } + div, err := ts.Float64() + if err != nil { + ctx.Logger().Error(err.Error()) + continue + } + + if div == 0 { + ctx.Logger().Error(sdkerrors.Wrap(types.ErrDivideByZero, "dividing by zero").Error()) + continue + } + + ratio := siv / div + + ctx.Logger().Debug("Ratio: %f\n", ratio) + + ff, err := sdk.NewDec(balance.Amount.Int64()).Float64() + if err != nil { + ctx.Logger().Error(err.Error()) + continue + } + coinfloat := ratio * ff + ctx.Logger().Debug("Coins: %f * %f = %f\n", ratio, ff, coinfloat) + + dd, err := sdk.NewDecFromStr(fmt.Sprintf("%f", coinfloat)) + if err != nil { + ctx.Logger().Error(err.Error()) + continue + } + + ctx.Logger().Debug("%f\n", dd) + coin := sdk.NewInt64Coin("ujkl", dd.TruncateInt64()) + coins := sdk.NewCoins(coin) + + provider, err := sdk.AccAddressFromBech32(deal.Provider) + if err != nil { + ctx.Logger().Error(err.Error()) + continue + } + ctx.Logger().Debug("Sending coins to %s\n", provider.String()) + errorr := k.bankkeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, provider, coins) + if errorr != nil { + ctx.Logger().Debug("ERR: %v\n", errorr) + ctx.Logger().Error(errorr.Error()) + continue + } + + ctx.Logger().Debug("%s\n", deal.Cid) + + deal.Proofverified = "false" + k.SetActiveDeals(ctx, deal) + + } + balance = k.bankkeeper.GetBalance(ctx, k.accountkeeper.GetModuleAddress(types.ModuleName), "ujkl") + + err := k.bankkeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(balance)) + if err != nil { + ctx.Logger().Error("ERR: %v\n", err) + return + } + } +} diff --git a/x/storage/keeper/strays.go b/x/storage/keeper/strays.go new file mode 100644 index 000000000..92d7d262a --- /dev/null +++ b/x/storage/keeper/strays.go @@ -0,0 +1,61 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// SetStrays set a specific strays in the store from its index +func (k Keeper) SetStrays(ctx sdk.Context, strays types.Strays) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.StraysKeyPrefix)) + b := k.cdc.MustMarshal(&strays) + store.Set(types.StraysKey( + strays.Cid, + ), b) +} + +// GetStrays returns a strays from its index +func (k Keeper) GetStrays( + ctx sdk.Context, + cid string, +) (val types.Strays, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.StraysKeyPrefix)) + + b := store.Get(types.StraysKey( + cid, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveStrays removes a strays from the store +func (k Keeper) RemoveStrays( + ctx sdk.Context, + cid string, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.StraysKeyPrefix)) + store.Delete(types.StraysKey( + cid, + )) +} + +// GetAllStrays returns all strays +func (k Keeper) GetAllStrays(ctx sdk.Context) (list []types.Strays) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.StraysKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Strays + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/storage/keeper/utils.go b/x/storage/keeper/utils.go new file mode 100644 index 000000000..935708b11 --- /dev/null +++ b/x/storage/keeper/utils.go @@ -0,0 +1,149 @@ +package keeper + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +const ( + StartBlockType = "start" + EndBlockType = "end" + TwoGigs = 2000000000 +) + +func (k Keeper) GetPaidAmount(ctx sdk.Context, address string, blockh int64) (int64, bool, *types.PayBlocks) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PayBlocksKeyPrefix)) + + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + var highestBlock int64 + + eblock, found := k.GetPayBlocks(ctx, fmt.Sprintf(".%s", address)) + if !found { + return TwoGigs, true, nil + } + + endblock, ok := sdk.NewIntFromString(eblock.Blocknum) + if !ok { + return TwoGigs, true, nil + } + + if endblock.Int64() <= blockh { + // one month grace period + if blockh-endblock.Int64() <= 432000 { + bytes, ok := sdk.NewIntFromString(eblock.Bytes) + if ok { + return bytes.Int64(), true, nil + } + } + return TwoGigs, true, &eblock + } + + highestBlock = 0 + + // Look for highest start block + for ; iterator.Valid(); iterator.Next() { + var val types.PayBlocks + k.cdc.MustUnmarshal(iterator.Value(), &val) + + ctx.Logger().Debug("BLOCK %s: %s", val.Blocktype, val.Blocknum) + + if val.Blocktype == EndBlockType { + continue + } + + adr := val.Blockid[:len(address)] + if adr != address { + continue + } + + blocknum, ok := sdk.NewIntFromString(val.Blocknum) + if !ok { + continue + } + + if blocknum.Int64() > blockh { + continue + } + + if blocknum.Int64() > highestBlock { + highestBlock = blocknum.Int64() + ctx.Logger().Debug(fmt.Sprintf("NEW HIGHEST BLOCK: %s", val.Blocknum)) + } + + } + + if highestBlock == 0 { + return TwoGigs, true, &eblock + } + + hblock, found := k.GetPayBlocks(ctx, fmt.Sprintf("%s%d", address, highestBlock)) + if !found { + return TwoGigs, true, &eblock + } + + bytes, ok := sdk.NewIntFromString(hblock.Bytes) + if !ok { + return TwoGigs, true, &eblock + } + + return bytes.Int64(), false, &eblock +} + +func (k Keeper) CreatePayBlock(ctx sdk.Context, address string, length int64, bytes int64) error { + startBlock := ctx.BlockHeight() + + endBlock := startBlock + length + + sBlock := types.PayBlocks{ + Blockid: fmt.Sprintf("%s%d", address, startBlock), + Bytes: fmt.Sprintf("%d", bytes), + Blocktype: StartBlockType, + Blocknum: fmt.Sprintf("%d", startBlock), + } + + eBlock := types.PayBlocks{ + Blockid: fmt.Sprintf(".%s", address), + Bytes: fmt.Sprintf("%d", bytes), + Blocktype: EndBlockType, + Blocknum: fmt.Sprintf("%d", endBlock), + } + + amount, trial, _ := k.GetPaidAmount(ctx, address, startBlock) + + if !trial && bytes <= amount { // Not in trial and new storage space is + // smaller than already paid amount + return fmt.Errorf("can't buy storage within another storage window") + } + + k.SetPayBlocks(ctx, sBlock) + k.SetPayBlocks(ctx, eBlock) + + return nil +} + +func (k Keeper) GetProviderUsing(ctx sdk.Context, provider string) int64 { + allDeals := k.GetAllActiveDeals(ctx) + + var space int64 + for i := 0; i < len(allDeals); i++ { + deal := allDeals[i] + if deal.Provider != provider { + continue + } + size, ok := sdk.NewIntFromString(deal.Filesize) + if !ok { + continue + } + + space += size.Int64() + + } + + return space +} diff --git a/x/storage/keeper/utils_test.go b/x/storage/keeper/utils_test.go new file mode 100644 index 000000000..77ef0c85e --- /dev/null +++ b/x/storage/keeper/utils_test.go @@ -0,0 +1,167 @@ +package keeper_test + +import ( + module "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func (suite *KeeperTestSuite) TestGetPaidAmount() { + suite.SetupSuite() + _, sKeeper, _ := setupMsgServer(suite) + + cases := []struct { + name string + preRun func() (string, int64) + paidAmt int64 + free bool + payBlock *types.PayBlocks + }{ + { + name: "no_payblock", + preRun: func() (string, int64) { + suite.ctx = suite.ctx.WithBlockHeight(100) + return "cosmos17j2hkm7n9fz9dpntyj2kxgxy5pthzd289nvlfl", 1 + }, + paidAmt: module.TwoGigs, + free: true, + payBlock: nil, + }, + + { + name: "Invalid_endblock_blocknum", + preRun: func() (string, int64) { + pbs := types.PayBlocks{ + Blockid: "123", + Bytes: "100000000000", + Blocktype: module.StartBlockType, + Blocknum: "aabbcc", + } + pbe := types.PayBlocks{ + // endblock blockid starts with '.' + Blockid: ".123", + Bytes: "100000000000", + Blocktype: module.EndBlockType, + Blocknum: "aabbcc", + } + sKeeper.SetPayBlocks(suite.ctx, pbs) + sKeeper.SetPayBlocks(suite.ctx, pbe) + return "123", 0 + }, + paidAmt: module.TwoGigs, + free: true, + payBlock: nil, + }, + + { + name: "invalid_eblock_bytes", + preRun: func() (string, int64) { + eBlock, found := sKeeper.GetPayBlocks(suite.ctx, ".123") + suite.Require().True(found) + eBlock.Blocknum = "10" + eBlock.Bytes = "aabbcc" + sKeeper.SetPayBlocks(suite.ctx, eBlock) + return "123", 100 + }, + paidAmt: module.TwoGigs, + free: true, + payBlock: &types.PayBlocks{ + Blockid: ".123", + Bytes: "aabbcc", + Blocktype: module.EndBlockType, + Blocknum: "10", + }, + }, + + { + name: "one_month_grace_period", + preRun: func() (string, int64) { + eBlock, found := sKeeper.GetPayBlocks(suite.ctx, ".123") + suite.Require().True(found) + eBlock.Bytes = "10000000000" + sKeeper.SetPayBlocks(suite.ctx, eBlock) + return "123", 100 + }, + paidAmt: 10000000000, + free: true, + payBlock: nil, + }, + + { + name: "highest_block_zero", + preRun: func() (string, int64) { + suite.ctx = suite.ctx.WithBlockHeight(0) + return "123", 1 + }, + paidAmt: module.TwoGigs, + free: true, + payBlock: &types.PayBlocks{ + Blockid: ".123", + Bytes: "10000000000", + Blocktype: module.EndBlockType, + Blocknum: "10", + }, + }, + + { + name: "highestblock_has_invalid_bytes", + preRun: func() (string, int64) { + suite.ctx = suite.ctx.WithBlockHeight(1000) + pbs := types.PayBlocks{ + Blockid: "123100", + Bytes: "aabbcc", + Blocktype: module.StartBlockType, + Blocknum: "100", + } + pbe := types.PayBlocks{ + Blockid: ".123", + Bytes: "100000000000", + Blocktype: module.EndBlockType, + Blocknum: "200000", + } + sKeeper.SetPayBlocks(suite.ctx, pbs) + sKeeper.SetPayBlocks(suite.ctx, pbe) + return "123", 10000 + }, + paidAmt: module.TwoGigs, + free: true, + payBlock: &types.PayBlocks{ + Blockid: ".123", + Bytes: "100000000000", + Blocktype: module.EndBlockType, + Blocknum: "200000", + }, + }, + + { + name: "successful_paid_amount_returned", + preRun: func() (string, int64) { + pbs, found := sKeeper.GetPayBlocks(suite.ctx, "123100") + suite.Require().True(found) + pbs.Bytes = "100000000000" + sKeeper.SetPayBlocks(suite.ctx, pbs) + return "123", 10000 + }, + paidAmt: 100000000000, + free: false, + payBlock: &types.PayBlocks{ + Blockid: ".123", + Bytes: "100000000000", + Blocktype: module.EndBlockType, + Blocknum: "200000", + }, + }, + } + + for _, tc := range cases { + suite.Run(tc.name, func() { + // preRun must be defined to get MsgPostContract + suite.Require().NotNil(tc.preRun) + addr, blockh := tc.preRun() + rPaidAmt, rFree, rPayBlock := sKeeper.GetPaidAmount(suite.ctx, addr, blockh) + + suite.Require().Equal(tc.paidAmt, rPaidAmt) + suite.Require().Equal(tc.free, rFree) + suite.Require().Equal(tc.payBlock, rPayBlock) + }) + } +} diff --git a/x/storage/module.go b/x/storage/module.go new file mode 100644 index 000000000..fb5f97a10 --- /dev/null +++ b/x/storage/module.go @@ -0,0 +1,180 @@ +package storage + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/tendermint/tendermint/abci/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/jackalLabs/canine-chain/x/storage/client/cli" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface for the capability module. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the capability module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +// RegisterInterfaces registers the module's interface types +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns the capability module's default genesis state. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis performs genesis state validation for the capability module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterRESTRoutes registers the capability module's REST service handlers. +func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) + if err != nil { + fmt.Println(err) + } +} + +// GetTxCmd returns the capability module's root tx command. +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the capability module's root query command. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface for the capability module. +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// Name returns the capability module's name. +func (am AppModule) Name() string { + return am.AppModuleBasic.Name() +} + +// Route returns the capability module's message routing key. +func (am AppModule) Route() sdk.Route { + return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) +} + +// QuerierRoute returns the capability module's query routing key. +func (AppModule) QuerierRoute() string { return types.QuerierRoute } + +// LegacyQuerierHandler returns the capability module's Querier. +func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { + return nil +} + +// RegisterServices registers a GRPC query service to respond to the +// module-specific GRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the capability module's invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the capability module's genesis initialization It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the capability module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion implements ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 2 } + +// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { // Every x blocks we check for proven deals + BeginBlocker(ctx, am.keeper) +} + +// EndBlock executes all ABCI EndBlock logic respective to the capability module. It +// returns no validator updates. +func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} diff --git a/x/storage/module_simulation.go b/x/storage/module_simulation.go new file mode 100644 index 000000000..6318f69bc --- /dev/null +++ b/x/storage/module_simulation.go @@ -0,0 +1,219 @@ +package storage + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + simappparams "github.com/cosmos/cosmos-sdk/simapp/params" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + storagesimulation "github.com/jackalLabs/canine-chain/x/storage/simulation" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +// avoid unused import issue +var ( + // _ = sample.AccAddress + _ = storagesimulation.FindAccount + _ = simappparams.StakePerAccount + _ = simulation.MsgEntryKind + _ = baseapp.Paramspace +) + +const ( + //nolint:all + opWeightMsgPostContract = "op_weight_msg_post_contract" + // TODO: Determine the simulation weight value + defaultWeightMsgPostContract int = 100 + + //nolint:all + opWeightMsgPostproof = "op_weight_msg_postproof" + // TODO: Determine the simulation weight value + defaultWeightMsgPostproof int = 100 + + //nolint:all + opWeightMsgSignContract = "op_weight_msg_sign_contract" + // TODO: Determine the simulation weight value + defaultWeightMsgSignContract int = 100 + + //nolint:all + opWeightMsgSetProviderIP = "op_weight_msg_set_provider_ip" + // TODO: Determine the simulation weight value + defaultWeightMsgSetProviderIP int = 100 + + //nolint:all + opWeightMsgSetProviderTotalspace = "op_weight_msg_set_provider_totalspace" + // TODO: Determine the simulation weight value + defaultWeightMsgSetProviderTotalspace int = 100 + + //nolint:all + opWeightMsgInitProvider = "op_weight_msg_init_provider" + // TODO: Determine the simulation weight value + defaultWeightMsgInitProvider int = 100 + + //nolint:all + opWeightMsgCancelContract = "op_weight_msg_cancel_contract" + // TODO: Determine the simulation weight value + defaultWeightMsgCancelContract int = 100 + + //nolint:all + opWeightMsgBuyStorage = "op_weight_msg_buy_storage" + // TODO: Determine the simulation weight value + defaultWeightMsgBuyStorage int = 100 + + // this line is used by starport scaffolding # simapp/module/const +) + +// GenerateGenesisState creates a randomized GenState of the module +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + storageGenesis := types.GenesisState{ + ContractsList: []types.Contracts{ + // { + // Creator: sample.AccAddress(), + // Cid: "0", + // }, + // { + // Creator: sample.AccAddress(), + // Cid: "1", + // }, + }, + ActiveDealsList: []types.ActiveDeals{ + // { + // Creator: sample.AccAddress(), + // Cid: "0", + // }, + // { + // Creator: sample.AccAddress(), + // Cid: "1", + // }, + }, + ProvidersList: []types.Providers{ + // { + // Creator: sample.AccAddress(), + // Address: "0", + // }, + // { + // Creator: sample.AccAddress(), + // Address: "1", + // }, + }, + // this line is used by starport scaffolding # simapp/module/genesisState + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&storageGenesis) +} + +// ProposalContents doesn't return any content functions for governance proposals +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RandomizedParams creates randomized param changes for the simulator +func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { + return []simtypes.ParamChange{} +} + +// RegisterStoreDecoder registers a decoder +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + var weightMsgPostContract int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgPostContract, &weightMsgPostContract, nil, + func(_ *rand.Rand) { + weightMsgPostContract = defaultWeightMsgPostContract + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgPostContract, + storagesimulation.SimulateMsgPostContract(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgPostproof int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgPostproof, &weightMsgPostproof, nil, + func(_ *rand.Rand) { + weightMsgPostproof = defaultWeightMsgPostproof + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgPostproof, + storagesimulation.SimulateMsgPostproof(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgSignContract int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgSignContract, &weightMsgSignContract, nil, + func(_ *rand.Rand) { + weightMsgSignContract = defaultWeightMsgSignContract + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgSignContract, + storagesimulation.SimulateMsgSignContract(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgSetProviderIP int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgSetProviderIP, &weightMsgSetProviderIP, nil, + func(_ *rand.Rand) { + weightMsgSetProviderIP = defaultWeightMsgSetProviderIP + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgSetProviderIP, + storagesimulation.SimulateMsgSetProviderIP(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgSetProviderTotalspace int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgSetProviderTotalspace, &weightMsgSetProviderTotalspace, nil, + func(_ *rand.Rand) { + weightMsgSetProviderTotalspace = defaultWeightMsgSetProviderTotalspace + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgSetProviderTotalspace, + storagesimulation.SimulateMsgSetProviderTotalspace(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgInitProvider int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgInitProvider, &weightMsgInitProvider, nil, + func(_ *rand.Rand) { + weightMsgInitProvider = defaultWeightMsgInitProvider + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgInitProvider, + storagesimulation.SimulateMsgInitProvider(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgCancelContract int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgCancelContract, &weightMsgCancelContract, nil, + func(_ *rand.Rand) { + weightMsgCancelContract = defaultWeightMsgCancelContract + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgCancelContract, + storagesimulation.SimulateMsgCancelContract(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgBuyStorage int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgBuyStorage, &weightMsgBuyStorage, nil, + func(_ *rand.Rand) { + weightMsgBuyStorage = defaultWeightMsgBuyStorage + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgBuyStorage, + storagesimulation.SimulateMsgBuyStorage(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + // this line is used by starport scaffolding # simapp/module/operation + + return operations +} diff --git a/x/storage/simulation/buy_storage.go b/x/storage/simulation/buy_storage.go new file mode 100644 index 000000000..ceccedad8 --- /dev/null +++ b/x/storage/simulation/buy_storage.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func SimulateMsgBuyStorage( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgBuyStorage{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the BuyStorage simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "BuyStorage simulation not implemented"), nil, nil + } +} diff --git a/x/storage/simulation/cancel_contract.go b/x/storage/simulation/cancel_contract.go new file mode 100644 index 000000000..16743d092 --- /dev/null +++ b/x/storage/simulation/cancel_contract.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func SimulateMsgCancelContract( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgCancelContract{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the CancelContract simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "CancelContract simulation not implemented"), nil, nil + } +} diff --git a/x/storage/simulation/init_miner.go b/x/storage/simulation/init_miner.go new file mode 100644 index 000000000..31613aa88 --- /dev/null +++ b/x/storage/simulation/init_miner.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func SimulateMsgInitProvider( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgInitProvider{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the InitProvider simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "InitProvider simulation not implemented"), nil, nil + } +} diff --git a/x/storage/simulation/post_contract.go b/x/storage/simulation/post_contract.go new file mode 100644 index 000000000..1d73e3381 --- /dev/null +++ b/x/storage/simulation/post_contract.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func SimulateMsgPostContract( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgPostContract{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the PostContract simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "PostContract simulation not implemented"), nil, nil + } +} diff --git a/x/storage/simulation/postproof.go b/x/storage/simulation/postproof.go new file mode 100644 index 000000000..0e8bb2506 --- /dev/null +++ b/x/storage/simulation/postproof.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func SimulateMsgPostproof( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgPostproof{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the Postproof simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Postproof simulation not implemented"), nil, nil + } +} diff --git a/x/storage/simulation/set_miner_ip.go b/x/storage/simulation/set_miner_ip.go new file mode 100644 index 000000000..7e4b9fe71 --- /dev/null +++ b/x/storage/simulation/set_miner_ip.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func SimulateMsgSetProviderIP( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgSetProviderIP{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the SetProviderIp simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "SetProviderIp simulation not implemented"), nil, nil + } +} diff --git a/x/storage/simulation/set_miner_totalspace.go b/x/storage/simulation/set_miner_totalspace.go new file mode 100644 index 000000000..f46f724f0 --- /dev/null +++ b/x/storage/simulation/set_miner_totalspace.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func SimulateMsgSetProviderTotalspace( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgSetProviderTotalspace{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the SetProviderTotalspace simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "SetProviderTotalspace simulation not implemented"), nil, nil + } +} diff --git a/x/storage/simulation/sign_contract.go b/x/storage/simulation/sign_contract.go new file mode 100644 index 000000000..45da26186 --- /dev/null +++ b/x/storage/simulation/sign_contract.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/jackalLabs/canine-chain/x/storage/keeper" + "github.com/jackalLabs/canine-chain/x/storage/types" +) + +func SimulateMsgSignContract( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgSignContract{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the SignContract simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "SignContract simulation not implemented"), nil, nil + } +} diff --git a/x/storage/simulation/simap.go b/x/storage/simulation/simap.go new file mode 100644 index 000000000..92c437c0d --- /dev/null +++ b/x/storage/simulation/simap.go @@ -0,0 +1,15 @@ +package simulation + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} diff --git a/x/storage/testutil/expected_keepers_mocks.go b/x/storage/testutil/expected_keepers_mocks.go new file mode 100644 index 000000000..d05b0e0aa --- /dev/null +++ b/x/storage/testutil/expected_keepers_mocks.go @@ -0,0 +1,199 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: x/storage/types/expected_keepers.go + +// Package testutil is a generated GoMock package. +package testutil + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/x/auth/types" + gomock "github.com/golang/mock/gomock" +) + +// MockAccountKeeper is a mock of AccountKeeper interface. +type MockAccountKeeper struct { + ctrl *gomock.Controller + recorder *MockAccountKeeperMockRecorder +} + +// MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. +type MockAccountKeeperMockRecorder struct { + mock *MockAccountKeeper +} + +// NewMockAccountKeeper creates a new mock instance. +func NewMockAccountKeeper(ctrl *gomock.Controller) *MockAccountKeeper { + mock := &MockAccountKeeper{ctrl: ctrl} + mock.recorder = &MockAccountKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder { + return m.recorder +} + +// GetAccount mocks base method. +func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccount", ctx, addr) + ret0, _ := ret[0].(types0.AccountI) + return ret0 +} + +// GetAccount indicates an expected call of GetAccount. +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) +} + +// GetModuleAddress mocks base method. +func (m *MockAccountKeeper) GetModuleAddress(moduleName string) types.AccAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAddress", moduleName) + ret0, _ := ret[0].(types.AccAddress) + return ret0 +} + +// GetModuleAddress indicates an expected call of GetModuleAddress. +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), moduleName) +} + +// MockBankKeeper is a mock of BankKeeper interface. +type MockBankKeeper struct { + ctrl *gomock.Controller + recorder *MockBankKeeperMockRecorder +} + +// MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. +type MockBankKeeperMockRecorder struct { + mock *MockBankKeeper +} + +// NewMockBankKeeper creates a new mock instance. +func NewMockBankKeeper(ctrl *gomock.Controller) *MockBankKeeper { + mock := &MockBankKeeper{ctrl: ctrl} + mock.recorder = &MockBankKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder { + return m.recorder +} + +// BurnCoins mocks base method. +func (m *MockBankKeeper) BurnCoins(ctx types.Context, moduleName string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BurnCoins", ctx, moduleName, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// BurnCoins indicates an expected call of BurnCoins. +func (mr *MockBankKeeperMockRecorder) BurnCoins(ctx, moduleName, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BurnCoins", reflect.TypeOf((*MockBankKeeper)(nil).BurnCoins), ctx, moduleName, amt) +} + +// GetAllBalances mocks base method. +func (m *MockBankKeeper) GetAllBalances(ctx types.Context, addr types.AccAddress) types.Coins { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllBalances", ctx, addr) + ret0, _ := ret[0].(types.Coins) + return ret0 +} + +// GetAllBalances indicates an expected call of GetAllBalances. +func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr) +} + +// GetBalance mocks base method. +func (m *MockBankKeeper) GetBalance(ctx types.Context, addrr types.AccAddress, denom string) types.Coin { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBalance", ctx, addrr, denom) + ret0, _ := ret[0].(types.Coin) + return ret0 +} + +// GetBalance indicates an expected call of GetBalance. +func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addrr, denom interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBalance", reflect.TypeOf((*MockBankKeeper)(nil).GetBalance), ctx, addrr, denom) +} + +// MintCoins mocks base method. +func (m *MockBankKeeper) MintCoins(ctx types.Context, moduleName string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MintCoins", ctx, moduleName, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// MintCoins indicates an expected call of MintCoins. +func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, moduleName, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MintCoins", reflect.TypeOf((*MockBankKeeper)(nil).MintCoins), ctx, moduleName, amt) +} + +// SendCoinsFromAccountToModule mocks base method. +func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx types.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromAccountToModule", ctx, senderAddr, recipientModule, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) +} + +// SendCoinsFromModuleToAccount mocks base method. +func (m *MockBankKeeper) SendCoinsFromModuleToAccount(ctx types.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromModuleToAccount", ctx, senderModule, recipientAddr, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) +} + +// SendCoinsFromModuleToModule mocks base method. +func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx types.Context, senderModule, recipientModule string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromModuleToModule", ctx, senderModule, recipientModule, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoinsFromModuleToModule indicates an expected call of SendCoinsFromModuleToModule. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToModule), ctx, senderModule, recipientModule, amt) +} + +// SpendableCoins mocks base method. +func (m *MockBankKeeper) SpendableCoins(ctx types.Context, addr types.AccAddress) types.Coins { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SpendableCoins", ctx, addr) + ret0, _ := ret[0].(types.Coins) + return ret0 +} + +// SpendableCoins indicates an expected call of SpendableCoins. +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) +} diff --git a/x/storage/types/active_deals.pb.go b/x/storage/types/active_deals.pb.go new file mode 100644 index 000000000..89ea6e11d --- /dev/null +++ b/x/storage/types/active_deals.pb.go @@ -0,0 +1,888 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: canine-chain/storage/active_deals.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type ActiveDeals struct { + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` + Signee string `protobuf:"bytes,2,opt,name=signee,proto3" json:"signee,omitempty"` + Provider string `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` + Startblock string `protobuf:"bytes,4,opt,name=startblock,proto3" json:"startblock,omitempty"` + Endblock string `protobuf:"bytes,5,opt,name=endblock,proto3" json:"endblock,omitempty"` + Filesize string `protobuf:"bytes,6,opt,name=filesize,proto3" json:"filesize,omitempty"` + Proofverified string `protobuf:"bytes,7,opt,name=proofverified,proto3" json:"proofverified,omitempty"` + Proofsmissed string `protobuf:"bytes,8,opt,name=proofsmissed,proto3" json:"proofsmissed,omitempty"` + Blocktoprove string `protobuf:"bytes,9,opt,name=blocktoprove,proto3" json:"blocktoprove,omitempty"` + Creator string `protobuf:"bytes,10,opt,name=creator,proto3" json:"creator,omitempty"` + Merkle string `protobuf:"bytes,11,opt,name=merkle,proto3" json:"merkle,omitempty"` + Fid string `protobuf:"bytes,12,opt,name=fid,proto3" json:"fid,omitempty"` +} + +func (m *ActiveDeals) Reset() { *m = ActiveDeals{} } +func (m *ActiveDeals) String() string { return proto.CompactTextString(m) } +func (*ActiveDeals) ProtoMessage() {} +func (*ActiveDeals) Descriptor() ([]byte, []int) { + return fileDescriptor_23693d861d06e409, []int{0} +} +func (m *ActiveDeals) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ActiveDeals) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ActiveDeals.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ActiveDeals) XXX_Merge(src proto.Message) { + xxx_messageInfo_ActiveDeals.Merge(m, src) +} +func (m *ActiveDeals) XXX_Size() int { + return m.Size() +} +func (m *ActiveDeals) XXX_DiscardUnknown() { + xxx_messageInfo_ActiveDeals.DiscardUnknown(m) +} + +var xxx_messageInfo_ActiveDeals proto.InternalMessageInfo + +func (m *ActiveDeals) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +func (m *ActiveDeals) GetSignee() string { + if m != nil { + return m.Signee + } + return "" +} + +func (m *ActiveDeals) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +func (m *ActiveDeals) GetStartblock() string { + if m != nil { + return m.Startblock + } + return "" +} + +func (m *ActiveDeals) GetEndblock() string { + if m != nil { + return m.Endblock + } + return "" +} + +func (m *ActiveDeals) GetFilesize() string { + if m != nil { + return m.Filesize + } + return "" +} + +func (m *ActiveDeals) GetProofverified() string { + if m != nil { + return m.Proofverified + } + return "" +} + +func (m *ActiveDeals) GetProofsmissed() string { + if m != nil { + return m.Proofsmissed + } + return "" +} + +func (m *ActiveDeals) GetBlocktoprove() string { + if m != nil { + return m.Blocktoprove + } + return "" +} + +func (m *ActiveDeals) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *ActiveDeals) GetMerkle() string { + if m != nil { + return m.Merkle + } + return "" +} + +func (m *ActiveDeals) GetFid() string { + if m != nil { + return m.Fid + } + return "" +} + +func init() { + proto.RegisterType((*ActiveDeals)(nil), "jackaldao.canine.storage.ActiveDeals") +} + +func init() { + proto.RegisterFile("canine-chain/storage/active_deals.proto", fileDescriptor_23693d861d06e409) +} + +var fileDescriptor_23693d861d06e409 = []byte{ + // 326 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x51, 0x4d, 0x4e, 0x02, 0x31, + 0x14, 0x66, 0x40, 0xf9, 0x29, 0x98, 0x98, 0x2e, 0xcc, 0x8b, 0x8b, 0x89, 0x21, 0x26, 0xba, 0x90, + 0x99, 0x85, 0x27, 0xd0, 0x18, 0x0f, 0xe0, 0xd2, 0x8d, 0x29, 0xed, 0x1b, 0x78, 0x32, 0x4c, 0x27, + 0x6d, 0x25, 0xea, 0x29, 0x3c, 0x96, 0x4b, 0x96, 0x6e, 0x4c, 0x0c, 0x5c, 0xc4, 0xb4, 0x05, 0x02, + 0xbb, 0x7e, 0x7f, 0xe9, 0xcb, 0xf7, 0xb1, 0x2b, 0x29, 0x2a, 0xaa, 0x70, 0x24, 0xa7, 0x82, 0xaa, + 0xdc, 0x3a, 0x6d, 0xc4, 0x04, 0x73, 0x21, 0x1d, 0x2d, 0xf0, 0x45, 0xa1, 0x28, 0x6d, 0x56, 0x1b, + 0xed, 0x34, 0x87, 0x57, 0x21, 0x67, 0xa2, 0x54, 0x42, 0x67, 0x31, 0x92, 0x6d, 0xcc, 0xc3, 0xdf, + 0x26, 0xeb, 0xdf, 0x85, 0xc0, 0x83, 0xf7, 0xf3, 0x53, 0xd6, 0x92, 0xa4, 0x20, 0xb9, 0x48, 0xae, + 0x7b, 0x4f, 0xfe, 0xc9, 0xcf, 0x58, 0xdb, 0xd2, 0xa4, 0x42, 0x84, 0x66, 0x20, 0x37, 0x88, 0x9f, + 0xb3, 0x6e, 0x6d, 0xf4, 0x82, 0x14, 0x1a, 0x68, 0x05, 0x65, 0x87, 0x79, 0xca, 0x98, 0x75, 0xc2, + 0xb8, 0x71, 0xa9, 0xe5, 0x0c, 0x8e, 0x82, 0xba, 0xc7, 0xf8, 0x2c, 0x56, 0x2a, 0xaa, 0xc7, 0x31, + 0xbb, 0xc5, 0x5e, 0x2b, 0xa8, 0x44, 0x4b, 0x9f, 0x08, 0xed, 0xa8, 0x6d, 0x31, 0xbf, 0x64, 0x27, + 0xb5, 0xd1, 0xba, 0x58, 0xa0, 0xa1, 0x82, 0x50, 0x41, 0x27, 0x18, 0x0e, 0x49, 0x3e, 0x64, 0x83, + 0x40, 0xd8, 0x39, 0x59, 0x8b, 0x0a, 0xba, 0xc1, 0x74, 0xc0, 0x79, 0x4f, 0xf8, 0xce, 0x69, 0x7f, + 0x34, 0x42, 0x2f, 0x7a, 0xf6, 0x39, 0x0e, 0xac, 0x23, 0x0d, 0x0a, 0xa7, 0x0d, 0xb0, 0x20, 0x6f, + 0xa1, 0xef, 0x64, 0x8e, 0x66, 0x56, 0x22, 0xf4, 0x63, 0x27, 0x11, 0xf9, 0xf6, 0x0a, 0x52, 0x30, + 0x88, 0xed, 0x15, 0xa4, 0xee, 0x1f, 0xbf, 0x57, 0x69, 0xb2, 0x5c, 0xa5, 0xc9, 0xdf, 0x2a, 0x4d, + 0xbe, 0xd6, 0x69, 0x63, 0xb9, 0x4e, 0x1b, 0x3f, 0xeb, 0xb4, 0xf1, 0x7c, 0x33, 0x21, 0x37, 0x7d, + 0x1b, 0x67, 0x52, 0xcf, 0xf3, 0x38, 0xcf, 0x48, 0x09, 0x9d, 0xc7, 0x7d, 0xf2, 0xf7, 0xdd, 0x9c, + 0xee, 0xa3, 0x46, 0x3b, 0x6e, 0x87, 0x21, 0x6f, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x3b, + 0x93, 0x47, 0xf3, 0x01, 0x00, 0x00, +} + +func (m *ActiveDeals) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ActiveDeals) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActiveDeals) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Fid) > 0 { + i -= len(m.Fid) + copy(dAtA[i:], m.Fid) + i = encodeVarintActiveDeals(dAtA, i, uint64(len(m.Fid))) + i-- + dAtA[i] = 0x62 + } + if len(m.Merkle) > 0 { + i -= len(m.Merkle) + copy(dAtA[i:], m.Merkle) + i = encodeVarintActiveDeals(dAtA, i, uint64(len(m.Merkle))) + i-- + dAtA[i] = 0x5a + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintActiveDeals(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0x52 + } + if len(m.Blocktoprove) > 0 { + i -= len(m.Blocktoprove) + copy(dAtA[i:], m.Blocktoprove) + i = encodeVarintActiveDeals(dAtA, i, uint64(len(m.Blocktoprove))) + i-- + dAtA[i] = 0x4a + } + if len(m.Proofsmissed) > 0 { + i -= len(m.Proofsmissed) + copy(dAtA[i:], m.Proofsmissed) + i = encodeVarintActiveDeals(dAtA, i, uint64(len(m.Proofsmissed))) + i-- + dAtA[i] = 0x42 + } + if len(m.Proofverified) > 0 { + i -= len(m.Proofverified) + copy(dAtA[i:], m.Proofverified) + i = encodeVarintActiveDeals(dAtA, i, uint64(len(m.Proofverified))) + i-- + dAtA[i] = 0x3a + } + if len(m.Filesize) > 0 { + i -= len(m.Filesize) + copy(dAtA[i:], m.Filesize) + i = encodeVarintActiveDeals(dAtA, i, uint64(len(m.Filesize))) + i-- + dAtA[i] = 0x32 + } + if len(m.Endblock) > 0 { + i -= len(m.Endblock) + copy(dAtA[i:], m.Endblock) + i = encodeVarintActiveDeals(dAtA, i, uint64(len(m.Endblock))) + i-- + dAtA[i] = 0x2a + } + if len(m.Startblock) > 0 { + i -= len(m.Startblock) + copy(dAtA[i:], m.Startblock) + i = encodeVarintActiveDeals(dAtA, i, uint64(len(m.Startblock))) + i-- + dAtA[i] = 0x22 + } + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintActiveDeals(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0x1a + } + if len(m.Signee) > 0 { + i -= len(m.Signee) + copy(dAtA[i:], m.Signee) + i = encodeVarintActiveDeals(dAtA, i, uint64(len(m.Signee))) + i-- + dAtA[i] = 0x12 + } + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintActiveDeals(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintActiveDeals(dAtA []byte, offset int, v uint64) int { + offset -= sovActiveDeals(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ActiveDeals) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovActiveDeals(uint64(l)) + } + l = len(m.Signee) + if l > 0 { + n += 1 + l + sovActiveDeals(uint64(l)) + } + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovActiveDeals(uint64(l)) + } + l = len(m.Startblock) + if l > 0 { + n += 1 + l + sovActiveDeals(uint64(l)) + } + l = len(m.Endblock) + if l > 0 { + n += 1 + l + sovActiveDeals(uint64(l)) + } + l = len(m.Filesize) + if l > 0 { + n += 1 + l + sovActiveDeals(uint64(l)) + } + l = len(m.Proofverified) + if l > 0 { + n += 1 + l + sovActiveDeals(uint64(l)) + } + l = len(m.Proofsmissed) + if l > 0 { + n += 1 + l + sovActiveDeals(uint64(l)) + } + l = len(m.Blocktoprove) + if l > 0 { + n += 1 + l + sovActiveDeals(uint64(l)) + } + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovActiveDeals(uint64(l)) + } + l = len(m.Merkle) + if l > 0 { + n += 1 + l + sovActiveDeals(uint64(l)) + } + l = len(m.Fid) + if l > 0 { + n += 1 + l + sovActiveDeals(uint64(l)) + } + return n +} + +func sovActiveDeals(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozActiveDeals(x uint64) (n int) { + return sovActiveDeals(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ActiveDeals) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowActiveDeals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ActiveDeals: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ActiveDeals: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowActiveDeals + } + 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 ErrInvalidLengthActiveDeals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthActiveDeals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowActiveDeals + } + 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 ErrInvalidLengthActiveDeals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthActiveDeals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowActiveDeals + } + 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 ErrInvalidLengthActiveDeals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthActiveDeals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Provider = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Startblock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowActiveDeals + } + 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 ErrInvalidLengthActiveDeals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthActiveDeals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Startblock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endblock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowActiveDeals + } + 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 ErrInvalidLengthActiveDeals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthActiveDeals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endblock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filesize", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowActiveDeals + } + 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 ErrInvalidLengthActiveDeals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthActiveDeals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Filesize = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proofverified", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowActiveDeals + } + 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 ErrInvalidLengthActiveDeals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthActiveDeals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proofverified = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proofsmissed", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowActiveDeals + } + 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 ErrInvalidLengthActiveDeals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthActiveDeals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proofsmissed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blocktoprove", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowActiveDeals + } + 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 ErrInvalidLengthActiveDeals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthActiveDeals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blocktoprove = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + 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 ErrIntOverflowActiveDeals + } + 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 ErrInvalidLengthActiveDeals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthActiveDeals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Merkle", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowActiveDeals + } + 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 ErrInvalidLengthActiveDeals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthActiveDeals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Merkle = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowActiveDeals + } + 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 ErrInvalidLengthActiveDeals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthActiveDeals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipActiveDeals(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthActiveDeals + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipActiveDeals(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, ErrIntOverflowActiveDeals + } + 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, ErrIntOverflowActiveDeals + } + 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, ErrIntOverflowActiveDeals + } + 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, ErrInvalidLengthActiveDeals + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupActiveDeals + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthActiveDeals + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthActiveDeals = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowActiveDeals = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupActiveDeals = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/storage/types/client_usage.pb.go b/x/storage/types/client_usage.pb.go new file mode 100644 index 000000000..53acb9345 --- /dev/null +++ b/x/storage/types/client_usage.pb.go @@ -0,0 +1,369 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: canine-chain/storage/client_usage.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type ClientUsage struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Usage string `protobuf:"bytes,2,opt,name=usage,proto3" json:"usage,omitempty"` +} + +func (m *ClientUsage) Reset() { *m = ClientUsage{} } +func (m *ClientUsage) String() string { return proto.CompactTextString(m) } +func (*ClientUsage) ProtoMessage() {} +func (*ClientUsage) Descriptor() ([]byte, []int) { + return fileDescriptor_5d68f70c00c83f7e, []int{0} +} +func (m *ClientUsage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientUsage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientUsage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ClientUsage) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientUsage.Merge(m, src) +} +func (m *ClientUsage) XXX_Size() int { + return m.Size() +} +func (m *ClientUsage) XXX_DiscardUnknown() { + xxx_messageInfo_ClientUsage.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientUsage proto.InternalMessageInfo + +func (m *ClientUsage) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *ClientUsage) GetUsage() string { + if m != nil { + return m.Usage + } + return "" +} + +func init() { + proto.RegisterType((*ClientUsage)(nil), "jackaldao.canine.storage.ClientUsage") +} + +func init() { + proto.RegisterFile("canine-chain/storage/client_usage.proto", fileDescriptor_5d68f70c00c83f7e) +} + +var fileDescriptor_5d68f70c00c83f7e = []byte{ + // 188 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4f, 0x4e, 0xcc, 0xcb, + 0xcc, 0x4b, 0xd5, 0x4d, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x2f, 0x2e, 0xc9, 0x2f, 0x4a, 0x4c, 0x4f, + 0xd5, 0x4f, 0xce, 0xc9, 0x4c, 0xcd, 0x2b, 0x89, 0x2f, 0x2d, 0x4e, 0x4c, 0x4f, 0xd5, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xc8, 0x4a, 0x4c, 0xce, 0x4e, 0xcc, 0x49, 0x49, 0xcc, 0xd7, 0x83, + 0x68, 0xd1, 0x83, 0x2a, 0x56, 0xb2, 0xe5, 0xe2, 0x76, 0x06, 0xab, 0x0f, 0x05, 0x29, 0x17, 0x92, + 0xe0, 0x62, 0x4f, 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0x96, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, + 0x82, 0x71, 0x85, 0x44, 0xb8, 0x58, 0xc1, 0x26, 0x4a, 0x30, 0x81, 0xc5, 0x21, 0x1c, 0x27, 0xb7, + 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, + 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x49, 0xcf, 0x2c, 0xc9, 0x28, + 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87, 0xd8, 0xae, 0x9b, 0x92, 0x98, 0xaf, 0x0f, 0xb1, 0x5e, + 0xbf, 0x02, 0xee, 0xda, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x3b, 0x8d, 0x01, 0x01, + 0x00, 0x00, 0xff, 0xff, 0xb7, 0xaa, 0xfa, 0x4b, 0xd2, 0x00, 0x00, 0x00, +} + +func (m *ClientUsage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClientUsage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClientUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Usage) > 0 { + i -= len(m.Usage) + copy(dAtA[i:], m.Usage) + i = encodeVarintClientUsage(dAtA, i, uint64(len(m.Usage))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintClientUsage(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintClientUsage(dAtA []byte, offset int, v uint64) int { + offset -= sovClientUsage(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ClientUsage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovClientUsage(uint64(l)) + } + l = len(m.Usage) + if l > 0 { + n += 1 + l + sovClientUsage(uint64(l)) + } + return n +} + +func sovClientUsage(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozClientUsage(x uint64) (n int) { + return sovClientUsage(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ClientUsage) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClientUsage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClientUsage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientUsage: 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 ErrIntOverflowClientUsage + } + 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 ErrInvalidLengthClientUsage + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClientUsage + } + 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 Usage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClientUsage + } + 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 ErrInvalidLengthClientUsage + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClientUsage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Usage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClientUsage(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthClientUsage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipClientUsage(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, ErrIntOverflowClientUsage + } + 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, ErrIntOverflowClientUsage + } + 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, ErrIntOverflowClientUsage + } + 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, ErrInvalidLengthClientUsage + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupClientUsage + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthClientUsage + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthClientUsage = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowClientUsage = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupClientUsage = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/storage/types/codec.go b/x/storage/types/codec.go new file mode 100644 index 000000000..22a833a54 --- /dev/null +++ b/x/storage/types/codec.go @@ -0,0 +1,59 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func RegisterCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgPostContract{}, "storage/PostContract", nil) + cdc.RegisterConcrete(&MsgPostproof{}, "storage/Postproof", nil) + cdc.RegisterConcrete(&MsgSignContract{}, "storage/SignContract", nil) + cdc.RegisterConcrete(&MsgSetProviderIP{}, "storage/SetProviderIp", nil) + cdc.RegisterConcrete(&MsgSetProviderTotalspace{}, "storage/SetProviderTotalspace", nil) + cdc.RegisterConcrete(&MsgInitProvider{}, "storage/InitProvider", nil) + cdc.RegisterConcrete(&MsgCancelContract{}, "storage/CancelContract", nil) + cdc.RegisterConcrete(&MsgBuyStorage{}, "storage/BuyStorage", nil) + cdc.RegisterConcrete(&MsgClaimStray{}, "storage/ClaimStray", nil) + // this line is used by starport scaffolding # 2 +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgPostContract{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgPostproof{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgSignContract{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgSetProviderIP{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgSetProviderTotalspace{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgInitProvider{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgCancelContract{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgBuyStorage{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgClaimStray{}, + ) + // this line is used by starport scaffolding # 3 + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + Amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) +) diff --git a/x/storage/types/contracts.pb.go b/x/storage/types/contracts.pb.go new file mode 100644 index 000000000..689724933 --- /dev/null +++ b/x/storage/types/contracts.pb.go @@ -0,0 +1,732 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: canine-chain/storage/contracts.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Contracts struct { + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` + Priceamt string `protobuf:"bytes,2,opt,name=priceamt,proto3" json:"priceamt,omitempty"` + Pricedenom string `protobuf:"bytes,3,opt,name=pricedenom,proto3" json:"pricedenom,omitempty"` + Merkle string `protobuf:"bytes,5,opt,name=merkle,proto3" json:"merkle,omitempty"` + Signee string `protobuf:"bytes,6,opt,name=signee,proto3" json:"signee,omitempty"` + Duration string `protobuf:"bytes,7,opt,name=duration,proto3" json:"duration,omitempty"` + Filesize string `protobuf:"bytes,8,opt,name=filesize,proto3" json:"filesize,omitempty"` + Fid string `protobuf:"bytes,9,opt,name=fid,proto3" json:"fid,omitempty"` + Creator string `protobuf:"bytes,4,opt,name=creator,proto3" json:"creator,omitempty"` +} + +func (m *Contracts) Reset() { *m = Contracts{} } +func (m *Contracts) String() string { return proto.CompactTextString(m) } +func (*Contracts) ProtoMessage() {} +func (*Contracts) Descriptor() ([]byte, []int) { + return fileDescriptor_814f11cdb30fe88f, []int{0} +} +func (m *Contracts) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Contracts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Contracts.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Contracts) XXX_Merge(src proto.Message) { + xxx_messageInfo_Contracts.Merge(m, src) +} +func (m *Contracts) XXX_Size() int { + return m.Size() +} +func (m *Contracts) XXX_DiscardUnknown() { + xxx_messageInfo_Contracts.DiscardUnknown(m) +} + +var xxx_messageInfo_Contracts proto.InternalMessageInfo + +func (m *Contracts) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +func (m *Contracts) GetPriceamt() string { + if m != nil { + return m.Priceamt + } + return "" +} + +func (m *Contracts) GetPricedenom() string { + if m != nil { + return m.Pricedenom + } + return "" +} + +func (m *Contracts) GetMerkle() string { + if m != nil { + return m.Merkle + } + return "" +} + +func (m *Contracts) GetSignee() string { + if m != nil { + return m.Signee + } + return "" +} + +func (m *Contracts) GetDuration() string { + if m != nil { + return m.Duration + } + return "" +} + +func (m *Contracts) GetFilesize() string { + if m != nil { + return m.Filesize + } + return "" +} + +func (m *Contracts) GetFid() string { + if m != nil { + return m.Fid + } + return "" +} + +func (m *Contracts) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func init() { + proto.RegisterType((*Contracts)(nil), "jackaldao.canine.storage.Contracts") +} + +func init() { + proto.RegisterFile("canine-chain/storage/contracts.proto", fileDescriptor_814f11cdb30fe88f) +} + +var fileDescriptor_814f11cdb30fe88f = []byte{ + // 276 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xbf, 0x4e, 0xc3, 0x30, + 0x10, 0xc6, 0x6b, 0x0a, 0xfd, 0xe3, 0x09, 0x79, 0x40, 0x16, 0x83, 0x85, 0x10, 0x03, 0x03, 0x4d, + 0x06, 0xde, 0x00, 0x24, 0x1e, 0x80, 0x91, 0xed, 0x6a, 0x5f, 0xd2, 0xa3, 0x89, 0x1d, 0x39, 0xae, + 0x04, 0x3c, 0x05, 0x8f, 0xc5, 0xd8, 0x91, 0x11, 0x25, 0x33, 0xef, 0x80, 0x62, 0x37, 0x15, 0xdb, + 0xfd, 0x7e, 0xdf, 0x49, 0x77, 0xfa, 0xf8, 0x8d, 0x06, 0x4b, 0x16, 0x57, 0x7a, 0x03, 0x64, 0xf3, + 0x36, 0x38, 0x0f, 0x25, 0xe6, 0xda, 0xd9, 0xe0, 0x41, 0x87, 0x36, 0x6b, 0xbc, 0x0b, 0x4e, 0xc8, + 0x57, 0xd0, 0x5b, 0xa8, 0x0c, 0xb8, 0x2c, 0xed, 0x67, 0x87, 0xcd, 0xeb, 0x5f, 0xc6, 0x97, 0x8f, + 0xe3, 0xb6, 0x38, 0xe7, 0x53, 0x4d, 0x46, 0xb2, 0x2b, 0x76, 0xbb, 0x7c, 0x1e, 0x46, 0x71, 0xc9, + 0x17, 0x8d, 0x27, 0x8d, 0x50, 0x07, 0x79, 0x12, 0xf5, 0x91, 0x85, 0xe2, 0x3c, 0xce, 0x06, 0xad, + 0xab, 0xe5, 0x34, 0xa6, 0xff, 0x8c, 0xb8, 0xe0, 0xb3, 0x1a, 0xfd, 0xb6, 0x42, 0x79, 0x16, 0xb3, + 0x03, 0x0d, 0xbe, 0xa5, 0xd2, 0x22, 0xca, 0x59, 0xf2, 0x89, 0x86, 0x5b, 0x66, 0xe7, 0x21, 0x90, + 0xb3, 0x72, 0x9e, 0x6e, 0x8d, 0x3c, 0x64, 0x05, 0x55, 0xd8, 0xd2, 0x07, 0xca, 0x45, 0xca, 0x46, + 0x1e, 0xbe, 0x2e, 0xc8, 0xc8, 0x65, 0xfa, 0xba, 0x20, 0x23, 0x24, 0x9f, 0x6b, 0x8f, 0x10, 0x9c, + 0x97, 0xa7, 0xd1, 0x8e, 0xf8, 0xf0, 0xf4, 0xd5, 0x29, 0xb6, 0xef, 0x14, 0xfb, 0xe9, 0x14, 0xfb, + 0xec, 0xd5, 0x64, 0xdf, 0xab, 0xc9, 0x77, 0xaf, 0x26, 0x2f, 0x77, 0x25, 0x85, 0xcd, 0x6e, 0x9d, + 0x69, 0x57, 0xe7, 0xa9, 0xae, 0x95, 0x01, 0x97, 0xa7, 0xbe, 0xf2, 0xb7, 0x63, 0xb7, 0xe1, 0xbd, + 0xc1, 0x76, 0x3d, 0x8b, 0xc5, 0xde, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x27, 0xab, 0xb5, 0xb6, + 0x80, 0x01, 0x00, 0x00, +} + +func (m *Contracts) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Contracts) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Contracts) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Fid) > 0 { + i -= len(m.Fid) + copy(dAtA[i:], m.Fid) + i = encodeVarintContracts(dAtA, i, uint64(len(m.Fid))) + i-- + dAtA[i] = 0x4a + } + if len(m.Filesize) > 0 { + i -= len(m.Filesize) + copy(dAtA[i:], m.Filesize) + i = encodeVarintContracts(dAtA, i, uint64(len(m.Filesize))) + i-- + dAtA[i] = 0x42 + } + if len(m.Duration) > 0 { + i -= len(m.Duration) + copy(dAtA[i:], m.Duration) + i = encodeVarintContracts(dAtA, i, uint64(len(m.Duration))) + i-- + dAtA[i] = 0x3a + } + if len(m.Signee) > 0 { + i -= len(m.Signee) + copy(dAtA[i:], m.Signee) + i = encodeVarintContracts(dAtA, i, uint64(len(m.Signee))) + i-- + dAtA[i] = 0x32 + } + if len(m.Merkle) > 0 { + i -= len(m.Merkle) + copy(dAtA[i:], m.Merkle) + i = encodeVarintContracts(dAtA, i, uint64(len(m.Merkle))) + i-- + dAtA[i] = 0x2a + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintContracts(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0x22 + } + if len(m.Pricedenom) > 0 { + i -= len(m.Pricedenom) + copy(dAtA[i:], m.Pricedenom) + i = encodeVarintContracts(dAtA, i, uint64(len(m.Pricedenom))) + i-- + dAtA[i] = 0x1a + } + if len(m.Priceamt) > 0 { + i -= len(m.Priceamt) + copy(dAtA[i:], m.Priceamt) + i = encodeVarintContracts(dAtA, i, uint64(len(m.Priceamt))) + i-- + dAtA[i] = 0x12 + } + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintContracts(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintContracts(dAtA []byte, offset int, v uint64) int { + offset -= sovContracts(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Contracts) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovContracts(uint64(l)) + } + l = len(m.Priceamt) + if l > 0 { + n += 1 + l + sovContracts(uint64(l)) + } + l = len(m.Pricedenom) + if l > 0 { + n += 1 + l + sovContracts(uint64(l)) + } + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovContracts(uint64(l)) + } + l = len(m.Merkle) + if l > 0 { + n += 1 + l + sovContracts(uint64(l)) + } + l = len(m.Signee) + if l > 0 { + n += 1 + l + sovContracts(uint64(l)) + } + l = len(m.Duration) + if l > 0 { + n += 1 + l + sovContracts(uint64(l)) + } + l = len(m.Filesize) + if l > 0 { + n += 1 + l + sovContracts(uint64(l)) + } + l = len(m.Fid) + if l > 0 { + n += 1 + l + sovContracts(uint64(l)) + } + return n +} + +func sovContracts(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozContracts(x uint64) (n int) { + return sovContracts(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Contracts) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContracts + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Contracts: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Contracts: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContracts + } + 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 ErrInvalidLengthContracts + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthContracts + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Priceamt", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContracts + } + 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 ErrInvalidLengthContracts + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthContracts + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Priceamt = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pricedenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContracts + } + 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 ErrInvalidLengthContracts + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthContracts + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pricedenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowContracts + } + 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 ErrInvalidLengthContracts + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthContracts + } + 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 Merkle", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContracts + } + 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 ErrInvalidLengthContracts + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthContracts + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Merkle = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContracts + } + 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 ErrInvalidLengthContracts + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthContracts + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContracts + } + 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 ErrInvalidLengthContracts + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthContracts + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Duration = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filesize", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContracts + } + 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 ErrInvalidLengthContracts + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthContracts + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Filesize = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContracts + } + 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 ErrInvalidLengthContracts + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthContracts + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipContracts(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthContracts + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipContracts(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, ErrIntOverflowContracts + } + 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, ErrIntOverflowContracts + } + 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, ErrIntOverflowContracts + } + 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, ErrInvalidLengthContracts + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupContracts + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthContracts + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthContracts = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowContracts = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupContracts = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/storage/types/errors.go b/x/storage/types/errors.go new file mode 100644 index 000000000..23334b7ae --- /dev/null +++ b/x/storage/types/errors.go @@ -0,0 +1,14 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// x/storage module sentinel errors +var ( + ErrDivideByZero = sdkerrors.Register(ModuleName, 1110, "DivideByZero") + ErrProviderNotFound = sdkerrors.Register(ModuleName, 1111, "Provider not found. Please init your provider.") + ErrNotValidTotalSpace = sdkerrors.Register(ModuleName, 1112, "Not a valid total space. Please enter total number of bytes to provide.") +) diff --git a/x/storage/types/expected_keepers.go b/x/storage/types/expected_keepers.go new file mode 100644 index 000000000..a040fb9aa --- /dev/null +++ b/x/storage/types/expected_keepers.go @@ -0,0 +1,27 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +// AccountKeeper defines the expected account keeper used for simulations (noalias) +type AccountKeeper interface { + GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetModuleAddress(moduleName string) sdk.AccAddress + // Methods imported from account should be defined here +} + +// BankKeeper defines the expected interface needed to retrieve account balances. +type BankKeeper interface { + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + + GetBalance(ctx sdk.Context, addrr sdk.AccAddress, denom string) sdk.Coin + GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + // Methods imported from bank should be defined here +} diff --git a/x/storage/types/fid_cid.pb.go b/x/storage/types/fid_cid.pb.go new file mode 100644 index 000000000..139fea010 --- /dev/null +++ b/x/storage/types/fid_cid.pb.go @@ -0,0 +1,369 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: canine-chain/storage/fid_cid.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type FidCid struct { + Fid string `protobuf:"bytes,1,opt,name=fid,proto3" json:"fid,omitempty"` + Cids string `protobuf:"bytes,2,opt,name=cids,proto3" json:"cids,omitempty"` +} + +func (m *FidCid) Reset() { *m = FidCid{} } +func (m *FidCid) String() string { return proto.CompactTextString(m) } +func (*FidCid) ProtoMessage() {} +func (*FidCid) Descriptor() ([]byte, []int) { + return fileDescriptor_4f4e56fb9751d7cb, []int{0} +} +func (m *FidCid) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FidCid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FidCid.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FidCid) XXX_Merge(src proto.Message) { + xxx_messageInfo_FidCid.Merge(m, src) +} +func (m *FidCid) XXX_Size() int { + return m.Size() +} +func (m *FidCid) XXX_DiscardUnknown() { + xxx_messageInfo_FidCid.DiscardUnknown(m) +} + +var xxx_messageInfo_FidCid proto.InternalMessageInfo + +func (m *FidCid) GetFid() string { + if m != nil { + return m.Fid + } + return "" +} + +func (m *FidCid) GetCids() string { + if m != nil { + return m.Cids + } + return "" +} + +func init() { + proto.RegisterType((*FidCid)(nil), "jackaldao.canine.storage.FidCid") +} + +func init() { + proto.RegisterFile("canine-chain/storage/fid_cid.proto", fileDescriptor_4f4e56fb9751d7cb) +} + +var fileDescriptor_4f4e56fb9751d7cb = []byte{ + // 181 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0x4e, 0xcc, 0xcb, + 0xcc, 0x4b, 0xd5, 0x4d, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x2f, 0x2e, 0xc9, 0x2f, 0x4a, 0x4c, 0x4f, + 0xd5, 0x4f, 0xcb, 0x4c, 0x89, 0x4f, 0xce, 0x4c, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, + 0xc8, 0x4a, 0x4c, 0xce, 0x4e, 0xcc, 0x49, 0x49, 0xcc, 0xd7, 0x83, 0xa8, 0xd6, 0x83, 0xaa, 0x53, + 0xd2, 0xe3, 0x62, 0x73, 0xcb, 0x4c, 0x71, 0xce, 0x4c, 0x11, 0x12, 0xe0, 0x62, 0x4e, 0xcb, 0x4c, + 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0x31, 0x85, 0x84, 0xb8, 0x58, 0x92, 0x33, 0x53, + 0x8a, 0x25, 0x98, 0xc0, 0x42, 0x60, 0xb6, 0x93, 0xdb, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, + 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, + 0xcb, 0x31, 0x44, 0xe9, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x43, + 0xac, 0xd3, 0x4d, 0x49, 0xcc, 0xd7, 0x87, 0xd8, 0xa7, 0x5f, 0x01, 0x77, 0x59, 0x49, 0x65, 0x41, + 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x61, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x65, 0x31, + 0x1a, 0xbe, 0x00, 0x00, 0x00, +} + +func (m *FidCid) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FidCid) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FidCid) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cids) > 0 { + i -= len(m.Cids) + copy(dAtA[i:], m.Cids) + i = encodeVarintFidCid(dAtA, i, uint64(len(m.Cids))) + i-- + dAtA[i] = 0x12 + } + if len(m.Fid) > 0 { + i -= len(m.Fid) + copy(dAtA[i:], m.Fid) + i = encodeVarintFidCid(dAtA, i, uint64(len(m.Fid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintFidCid(dAtA []byte, offset int, v uint64) int { + offset -= sovFidCid(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *FidCid) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Fid) + if l > 0 { + n += 1 + l + sovFidCid(uint64(l)) + } + l = len(m.Cids) + if l > 0 { + n += 1 + l + sovFidCid(uint64(l)) + } + return n +} + +func sovFidCid(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozFidCid(x uint64) (n int) { + return sovFidCid(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *FidCid) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFidCid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FidCid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FidCid: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFidCid + } + 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 ErrInvalidLengthFidCid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFidCid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cids", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFidCid + } + 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 ErrInvalidLengthFidCid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFidCid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cids = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFidCid(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFidCid + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipFidCid(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, ErrIntOverflowFidCid + } + 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, ErrIntOverflowFidCid + } + 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, ErrIntOverflowFidCid + } + 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, ErrInvalidLengthFidCid + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupFidCid + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthFidCid + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthFidCid = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowFidCid = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupFidCid = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/storage/types/genesis.go b/x/storage/types/genesis.go new file mode 100644 index 000000000..9a0291bd5 --- /dev/null +++ b/x/storage/types/genesis.go @@ -0,0 +1,102 @@ +package types + +import ( + "fmt" +) + +// DefaultIndex is the default capability global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default Capability genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + ContractsList: []Contracts{}, + ActiveDealsList: []ActiveDeals{}, + ProvidersList: []Providers{}, + PayBlocksList: []PayBlocks{}, + ClientUsageList: []ClientUsage{}, + StraysList: []Strays{}, + FidCidList: []FidCid{}, + // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // Check for duplicated index in contracts + contractsIndexMap := make(map[string]struct{}) + + for _, elem := range gs.ContractsList { + index := string(ContractsKey(elem.Cid)) + if _, ok := contractsIndexMap[index]; ok { + return fmt.Errorf("duplicated index for contracts") + } + contractsIndexMap[index] = struct{}{} + } + + // Check for duplicated index in activeDeals + activeDealsIndexMap := make(map[string]struct{}) + + for _, elem := range gs.ActiveDealsList { + index := string(ActiveDealsKey(elem.Cid)) + if _, ok := activeDealsIndexMap[index]; ok { + return fmt.Errorf("duplicated index for activeDeals") + } + activeDealsIndexMap[index] = struct{}{} + } + // Check for duplicated index in providers + providersIndexMap := make(map[string]struct{}) + + for _, elem := range gs.ProvidersList { + index := string(ProvidersKey(elem.Address)) + if _, ok := providersIndexMap[index]; ok { + return fmt.Errorf("duplicated index for providers") + } + providersIndexMap[index] = struct{}{} + } + // Check for duplicated index in payBlocks + payBlocksIndexMap := make(map[string]struct{}) + + for _, elem := range gs.PayBlocksList { + index := string(PayBlocksKey(elem.Blockid)) + if _, ok := payBlocksIndexMap[index]; ok { + return fmt.Errorf("duplicated index for payBlocks") + } + payBlocksIndexMap[index] = struct{}{} + } + // Check for duplicated index in clientUsage + clientUsageIndexMap := make(map[string]struct{}) + + for _, elem := range gs.ClientUsageList { + index := string(ClientUsageKey(elem.Address)) + if _, ok := clientUsageIndexMap[index]; ok { + return fmt.Errorf("duplicated index for clientUsage") + } + clientUsageIndexMap[index] = struct{}{} + } + // Check for duplicated index in strays + straysIndexMap := make(map[string]struct{}) + + for _, elem := range gs.StraysList { + index := string(StraysKey(elem.Cid)) + if _, ok := straysIndexMap[index]; ok { + return fmt.Errorf("duplicated index for strays") + } + straysIndexMap[index] = struct{}{} + } + // Check for duplicated index in fidCid + fidCidIndexMap := make(map[string]struct{}) + + for _, elem := range gs.FidCidList { + index := string(FidCidKey(elem.Fid)) + if _, ok := fidCidIndexMap[index]; ok { + return fmt.Errorf("duplicated index for fidCid") + } + fidCidIndexMap[index] = struct{}{} + } + // this line is used by starport scaffolding # genesis/types/validate + + return gs.Params.Validate() +} diff --git a/x/storage/types/genesis.pb.go b/x/storage/types/genesis.pb.go new file mode 100644 index 000000000..087edca89 --- /dev/null +++ b/x/storage/types/genesis.pb.go @@ -0,0 +1,771 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: canine-chain/storage/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/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 defines the storage module's genesis state. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + ContractsList []Contracts `protobuf:"bytes,2,rep,name=contractsList,proto3" json:"contractsList"` + ActiveDealsList []ActiveDeals `protobuf:"bytes,4,rep,name=activeDealsList,proto3" json:"activeDealsList"` + ProvidersList []Providers `protobuf:"bytes,5,rep,name=providersList,proto3" json:"providersList"` + PayBlocksList []PayBlocks `protobuf:"bytes,6,rep,name=payBlocksList,proto3" json:"payBlocksList"` + ClientUsageList []ClientUsage `protobuf:"bytes,7,rep,name=clientUsageList,proto3" json:"clientUsageList"` + StraysList []Strays `protobuf:"bytes,8,rep,name=straysList,proto3" json:"straysList"` + FidCidList []FidCid `protobuf:"bytes,3,rep,name=fidCidList,proto3" json:"fidCidList"` +} + +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_529bdbc9d39fd888, []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) GetContractsList() []Contracts { + if m != nil { + return m.ContractsList + } + return nil +} + +func (m *GenesisState) GetActiveDealsList() []ActiveDeals { + if m != nil { + return m.ActiveDealsList + } + return nil +} + +func (m *GenesisState) GetProvidersList() []Providers { + if m != nil { + return m.ProvidersList + } + return nil +} + +func (m *GenesisState) GetPayBlocksList() []PayBlocks { + if m != nil { + return m.PayBlocksList + } + return nil +} + +func (m *GenesisState) GetClientUsageList() []ClientUsage { + if m != nil { + return m.ClientUsageList + } + return nil +} + +func (m *GenesisState) GetStraysList() []Strays { + if m != nil { + return m.StraysList + } + return nil +} + +func (m *GenesisState) GetFidCidList() []FidCid { + if m != nil { + return m.FidCidList + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "jackaldao.canine.storage.GenesisState") +} + +func init() { + proto.RegisterFile("canine-chain/storage/genesis.proto", fileDescriptor_529bdbc9d39fd888) +} + +var fileDescriptor_529bdbc9d39fd888 = []byte{ + // 429 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcd, 0xce, 0xd2, 0x40, + 0x14, 0x86, 0x5b, 0x3f, 0x44, 0xd3, 0x4f, 0x63, 0xd2, 0xb8, 0x20, 0x2c, 0x2a, 0xa2, 0x44, 0x16, + 0xd2, 0x26, 0xb8, 0x37, 0x11, 0x0c, 0x6e, 0x4c, 0x24, 0x12, 0x36, 0x6e, 0x9a, 0xc3, 0xcc, 0x50, + 0x46, 0x4a, 0xa7, 0x69, 0x07, 0x62, 0xef, 0xc2, 0xcb, 0x62, 0xc9, 0xd2, 0x95, 0x31, 0x70, 0x21, + 0x7e, 0xe9, 0x4c, 0xa7, 0xfc, 0xa4, 0x3f, 0xbb, 0x2e, 0x9e, 0xf7, 0xe9, 0x39, 0xe7, 0x1d, 0xa3, + 0x8b, 0x20, 0xa0, 0x01, 0x19, 0xa0, 0x15, 0xd0, 0xc0, 0x89, 0x39, 0x8b, 0xc0, 0x23, 0x8e, 0x47, + 0x02, 0x12, 0xd3, 0xd8, 0x0e, 0x23, 0xc6, 0x99, 0xd9, 0xfa, 0x09, 0x68, 0x0d, 0x3e, 0x06, 0x66, + 0x4b, 0xda, 0xce, 0xb8, 0xf6, 0x4b, 0x8f, 0x79, 0x4c, 0x40, 0x4e, 0xfa, 0x25, 0xf9, 0xf6, 0xeb, + 0x42, 0x67, 0x08, 0x11, 0x6c, 0x32, 0x65, 0xfb, 0x6d, 0x21, 0x82, 0x58, 0xc0, 0x23, 0x40, 0x5c, + 0x51, 0xef, 0x0a, 0x29, 0x40, 0x9c, 0xee, 0x88, 0x8b, 0x09, 0xf8, 0xd5, 0xba, 0x30, 0x62, 0x3b, + 0x8a, 0x49, 0xa4, 0xa8, 0x5e, 0xc9, 0x5c, 0x89, 0xbb, 0xf0, 0x19, 0x5a, 0x57, 0xff, 0x15, 0xf9, + 0x94, 0x04, 0xdc, 0xdd, 0xc6, 0xe0, 0x91, 0xca, 0x3d, 0x63, 0x1e, 0x41, 0xa2, 0x5c, 0xc5, 0xe7, + 0x5d, 0x52, 0xec, 0x22, 0x8a, 0x25, 0xd3, 0xfd, 0xdf, 0x30, 0x9e, 0x7d, 0x91, 0x07, 0x9f, 0x71, + 0xe0, 0xc4, 0xfc, 0x68, 0x34, 0xe5, 0xb1, 0x5a, 0x7a, 0x47, 0xef, 0xdf, 0x0f, 0x3b, 0x76, 0x59, + 0x01, 0xf6, 0x54, 0x70, 0xa3, 0xc6, 0xfe, 0xef, 0x2b, 0xed, 0x7b, 0x96, 0x32, 0xbf, 0x19, 0xcf, + 0xf3, 0x4b, 0x7e, 0xa5, 0x31, 0x6f, 0x3d, 0xea, 0xdc, 0xf5, 0xef, 0x87, 0x6f, 0xca, 0x35, 0x63, + 0x85, 0x67, 0xa6, 0xeb, 0xbc, 0x39, 0x37, 0x5e, 0xc8, 0xa3, 0x7f, 0x4e, 0x6f, 0x2e, 0x94, 0x0d, + 0xa1, 0xec, 0x95, 0x2b, 0x3f, 0x9d, 0x03, 0x99, 0xf4, 0xd6, 0x91, 0xce, 0x99, 0x57, 0x24, 0xa4, + 0x8f, 0xeb, 0xe6, 0x9c, 0x2a, 0x5c, 0xcd, 0x79, 0x95, 0x17, 0x42, 0x48, 0x46, 0xa2, 0x4c, 0x21, + 0x6c, 0xd6, 0x0a, 0x15, 0x9e, 0x0b, 0x2f, 0xf3, 0xe9, 0xe2, 0xb2, 0xf7, 0x79, 0x5a, 0xbb, 0x50, + 0x3e, 0xa9, 0x5b, 0x7c, 0x7c, 0x0e, 0xa8, 0xc5, 0x6f, 0x1c, 0xe6, 0xc4, 0x30, 0xe4, 0x2b, 0x11, + 0xc6, 0xa7, 0xc2, 0x58, 0x51, 0xf2, 0x4c, 0xb0, 0x99, 0xec, 0x22, 0x99, 0x7a, 0x96, 0x14, 0x8f, + 0x29, 0x16, 0x9e, 0xbb, 0x3a, 0xcf, 0x44, 0xb0, 0xca, 0x73, 0x4e, 0x8e, 0x26, 0xfb, 0xa3, 0xa5, + 0x1f, 0x8e, 0x96, 0xfe, 0xef, 0x68, 0xe9, 0xbf, 0x4f, 0x96, 0x76, 0x38, 0x59, 0xda, 0x9f, 0x93, + 0xa5, 0xfd, 0x78, 0xef, 0x51, 0xbe, 0xda, 0x2e, 0x6c, 0xc4, 0x36, 0x8e, 0xf4, 0x0e, 0x30, 0x30, + 0x47, 0x8a, 0x9d, 0x5f, 0xf9, 0x8b, 0xe6, 0x49, 0x48, 0xe2, 0x45, 0x53, 0x3c, 0xe8, 0x0f, 0x0f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x23, 0x67, 0xa8, 0x9b, 0x55, 0x04, 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.StraysList) > 0 { + for iNdEx := len(m.StraysList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.StraysList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if len(m.ClientUsageList) > 0 { + for iNdEx := len(m.ClientUsageList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ClientUsageList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.PayBlocksList) > 0 { + for iNdEx := len(m.PayBlocksList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PayBlocksList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.ProvidersList) > 0 { + for iNdEx := len(m.ProvidersList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ProvidersList[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.ActiveDealsList) > 0 { + for iNdEx := len(m.ActiveDealsList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ActiveDealsList[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.FidCidList) > 0 { + for iNdEx := len(m.FidCidList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FidCidList[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.ContractsList) > 0 { + for iNdEx := len(m.ContractsList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ContractsList[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 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.ContractsList) > 0 { + for _, e := range m.ContractsList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.FidCidList) > 0 { + for _, e := range m.FidCidList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.ActiveDealsList) > 0 { + for _, e := range m.ActiveDealsList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.ProvidersList) > 0 { + for _, e := range m.ProvidersList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.PayBlocksList) > 0 { + for _, e := range m.PayBlocksList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.ClientUsageList) > 0 { + for _, e := range m.ClientUsageList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.StraysList) > 0 { + for _, e := range m.StraysList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + 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 ContractsList", 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.ContractsList = append(m.ContractsList, Contracts{}) + if err := m.ContractsList[len(m.ContractsList)-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 FidCidList", 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.FidCidList = append(m.FidCidList, FidCid{}) + if err := m.FidCidList[len(m.FidCidList)-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 ActiveDealsList", 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.ActiveDealsList = append(m.ActiveDealsList, ActiveDeals{}) + if err := m.ActiveDealsList[len(m.ActiveDealsList)-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 ProvidersList", 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.ProvidersList = append(m.ProvidersList, Providers{}) + if err := m.ProvidersList[len(m.ProvidersList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayBlocksList", 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.PayBlocksList = append(m.PayBlocksList, PayBlocks{}) + if err := m.PayBlocksList[len(m.PayBlocksList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientUsageList", 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.ClientUsageList = append(m.ClientUsageList, ClientUsage{}) + if err := m.ClientUsageList[len(m.ClientUsageList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StraysList", 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.StraysList = append(m.StraysList, Strays{}) + if err := m.StraysList[len(m.StraysList)-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 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/x/storage/types/genesis_test.go b/x/storage/types/genesis_test.go new file mode 100644 index 000000000..ec9cf7561 --- /dev/null +++ b/x/storage/types/genesis_test.go @@ -0,0 +1,193 @@ +package types_test + +import ( + "testing" + + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/stretchr/testify/require" +) + +func TestGenesisState_Validate(t *testing.T) { + for _, tc := range []struct { + desc string + genState *types.GenesisState + valid bool + }{ + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + ContractsList: []types.Contracts{ + { + Cid: "0", + }, + { + Cid: "1", + }, + }, + ActiveDealsList: []types.ActiveDeals{ + { + Cid: "0", + }, + { + Cid: "1", + }, + }, + ProvidersList: []types.Providers{ + { + Address: "0", + }, + { + Address: "1", + }, + }, + PayBlocksList: []types.PayBlocks{ + { + Blockid: "0", + }, + { + Blockid: "1", + }, + }, + ClientUsageList: []types.ClientUsage{ + { + Address: "0", + }, + { + Address: "1", + }, + }, + StraysList: []types.Strays{ + { + Cid: "0", + }, + { + Cid: "1", + }, + }, + FidCidList: []types.FidCid{ + { + Fid: "0", + }, + { + Fid: "1", + }, + }, + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + { + desc: "duplicated contracts", + genState: &types.GenesisState{ + ContractsList: []types.Contracts{ + { + Cid: "0", + }, + { + Cid: "0", + }, + }, + }, + valid: false, + }, + { + desc: "duplicated activeDeals", + genState: &types.GenesisState{ + ActiveDealsList: []types.ActiveDeals{ + { + Cid: "0", + }, + { + Cid: "0", + }, + }, + }, + valid: false, + }, + { + desc: "duplicated providers", + genState: &types.GenesisState{ + ProvidersList: []types.Providers{ + { + Address: "0", + }, + { + Address: "0", + }, + }, + }, + valid: false, + }, + { + desc: "duplicated payBlocks", + genState: &types.GenesisState{ + PayBlocksList: []types.PayBlocks{ + { + Blockid: "0", + }, + { + Blockid: "0", + }, + }, + }, + valid: false, + }, + { + desc: "duplicated clientUsage", + genState: &types.GenesisState{ + ClientUsageList: []types.ClientUsage{ + { + Address: "0", + }, + { + Address: "0", + }, + }, + }, + valid: false, + }, + { + desc: "duplicated strays", + genState: &types.GenesisState{ + StraysList: []types.Strays{ + { + Cid: "0", + }, + { + Cid: "0", + }, + }, + }, + valid: false, + }, + { + desc: "duplicated fidCid", + genState: &types.GenesisState{ + FidCidList: []types.FidCid{ + { + Fid: "0", + }, + { + Fid: "0", + }, + }, + }, + valid: false, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} diff --git a/x/storage/types/key_active_deals.go b/x/storage/types/key_active_deals.go new file mode 100644 index 000000000..1c667ab7c --- /dev/null +++ b/x/storage/types/key_active_deals.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // ActiveDealsKeyPrefix is the prefix to retrieve all ActiveDeals + ActiveDealsKeyPrefix = "ActiveDeals/value/" +) + +// ActiveDealsKey returns the store key to retrieve a ActiveDeals from the index fields +func ActiveDealsKey( + cid string, +) []byte { + var key []byte + + cidBytes := []byte(cid) + key = append(key, cidBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/storage/types/key_client_usage.go b/x/storage/types/key_client_usage.go new file mode 100644 index 000000000..76265ccab --- /dev/null +++ b/x/storage/types/key_client_usage.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // ClientUsageKeyPrefix is the prefix to retrieve all ClientUsage + ClientUsageKeyPrefix = "ClientUsage/value/" +) + +// ClientUsageKey returns the store key to retrieve a ClientUsage from the index fields +func ClientUsageKey( + address string, +) []byte { + var key []byte + + addressBytes := []byte(address) + key = append(key, addressBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/storage/types/key_contracts.go b/x/storage/types/key_contracts.go new file mode 100644 index 000000000..783fc89e7 --- /dev/null +++ b/x/storage/types/key_contracts.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // ContractsKeyPrefix is the prefix to retrieve all Contracts + ContractsKeyPrefix = "Contracts/value/" +) + +// ContractsKey returns the store key to retrieve a Contracts from the index fields +func ContractsKey( + cid string, +) []byte { + var key []byte + + cidBytes := []byte(cid) + key = append(key, cidBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/storage/types/key_fid_cid.go b/x/storage/types/key_fid_cid.go new file mode 100644 index 000000000..440b1d3ef --- /dev/null +++ b/x/storage/types/key_fid_cid.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // FidCidKeyPrefix is the prefix to retrieve all FidCid + FidCidKeyPrefix = "FidCid/value/" +) + +// FidCidKey returns the store key to retrieve a FidCid from the index fields +func FidCidKey( + fid string, +) []byte { + var key []byte + + fidBytes := []byte(fid) + key = append(key, fidBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/storage/types/key_pay_blocks.go b/x/storage/types/key_pay_blocks.go new file mode 100644 index 000000000..73037479e --- /dev/null +++ b/x/storage/types/key_pay_blocks.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // PayBlocksKeyPrefix is the prefix to retrieve all PayBlocks + PayBlocksKeyPrefix = "PayBlocks/value/" +) + +// PayBlocksKey returns the store key to retrieve a PayBlocks from the index fields +func PayBlocksKey( + blockid string, +) []byte { + var key []byte + + blockidBytes := []byte(blockid) + key = append(key, blockidBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/storage/types/key_proofs.go b/x/storage/types/key_proofs.go new file mode 100644 index 000000000..59b52ee52 --- /dev/null +++ b/x/storage/types/key_proofs.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // ProofsKeyPrefix is the prefix to retrieve all Proofs + ProofsKeyPrefix = "Proofs/value/" +) + +// ProofsKey returns the store key to retrieve a Proofs from the index fields +func ProofsKey( + cid string, +) []byte { + var key []byte + + cidBytes := []byte(cid) + key = append(key, cidBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/storage/types/key_providers.go b/x/storage/types/key_providers.go new file mode 100644 index 000000000..f1a878a71 --- /dev/null +++ b/x/storage/types/key_providers.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // ProvidersKeyPrefix is the prefix to retrieve all Providers + ProvidersKeyPrefix = "Providers/value/" +) + +// ProvidersKey returns the store key to retrieve a Providers from the index fields +func ProvidersKey( + address string, +) []byte { + var key []byte + + addressBytes := []byte(address) + key = append(key, addressBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/storage/types/key_strays.go b/x/storage/types/key_strays.go new file mode 100644 index 000000000..36b21c73b --- /dev/null +++ b/x/storage/types/key_strays.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // StraysKeyPrefix is the prefix to retrieve all Strays + StraysKeyPrefix = "Strays/value/" +) + +// StraysKey returns the store key to retrieve a Strays from the index fields +func StraysKey( + cid string, +) []byte { + var key []byte + + cidBytes := []byte(cid) + key = append(key, cidBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/storage/types/keys.go b/x/storage/types/keys.go new file mode 100644 index 000000000..748f3c56e --- /dev/null +++ b/x/storage/types/keys.go @@ -0,0 +1,22 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "storage" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey is the message route for slashing + RouterKey = ModuleName + + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_storage" +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/x/storage/types/message_buy_storage.go b/x/storage/types/message_buy_storage.go new file mode 100644 index 000000000..74869eb70 --- /dev/null +++ b/x/storage/types/message_buy_storage.go @@ -0,0 +1,73 @@ +package types + +import ( + fmt "fmt" + "strconv" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgBuyStorage = "buy_storage" + +var _ sdk.Msg = &MsgBuyStorage{} + +func NewMsgBuyStorage(creator string, forAddress string, duration string, bytes string, paymentDenom string) *MsgBuyStorage { + return &MsgBuyStorage{ + Creator: creator, + ForAddress: forAddress, + Duration: duration, + Bytes: bytes, + PaymentDenom: paymentDenom, + } +} + +func (msg *MsgBuyStorage) Route() string { + return RouterKey +} + +func (msg *MsgBuyStorage) Type() string { + return TypeMsgBuyStorage +} + +func (msg *MsgBuyStorage) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgBuyStorage) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgBuyStorage) ValidateBasic() error { + prefix, _, err := bech32.DecodeAndConvert(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if prefix != addressPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jkl`", prefix)) + } + + prefix, _, err = bech32.DecodeAndConvert(msg.ForAddress) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if prefix != addressPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jkl`", prefix)) + } + + if _, err := strconv.Atoi(msg.Bytes); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot parse bytes (%s)", err) + } + + if _, err := strconv.Atoi(msg.Duration); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot parse bytes (%s)", err) + } + + return nil +} diff --git a/x/storage/types/message_buy_storage_test.go b/x/storage/types/message_buy_storage_test.go new file mode 100644 index 000000000..b98068854 --- /dev/null +++ b/x/storage/types/message_buy_storage_test.go @@ -0,0 +1,77 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgBuyStorage_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgBuyStorage + err error + }{ + { + name: "invalid for address", + msg: MsgBuyStorage{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + ForAddress: "invalid_address", + Duration: "10000", + Bytes: "4096", + PaymentDenom: "ujkl", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "invalid from address", + msg: MsgBuyStorage{ + Creator: "invalid_address", + ForAddress: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Duration: "10000", + Bytes: "4096", + PaymentDenom: "ujkl", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "invalid duration", + msg: MsgBuyStorage{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + ForAddress: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Duration: "x", + Bytes: "4096", + PaymentDenom: "ujkl", + }, + err: sdkerrors.ErrInvalidType, + }, { + name: "invalid btyes", + msg: MsgBuyStorage{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + ForAddress: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Duration: "10000", + Bytes: "c", + PaymentDenom: "ujkl", + }, + err: sdkerrors.ErrInvalidType, + }, { + name: "valid address", + msg: MsgBuyStorage{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + ForAddress: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Duration: "10000", + Bytes: "4096", + PaymentDenom: "ujkl", + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/storage/types/message_cancel_contract.go b/x/storage/types/message_cancel_contract.go new file mode 100644 index 000000000..9fbf12ee6 --- /dev/null +++ b/x/storage/types/message_cancel_contract.go @@ -0,0 +1,60 @@ +package types + +import ( + fmt "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgCancelContract = "cancel_contract" + +var _ sdk.Msg = &MsgCancelContract{} + +func NewMsgCancelContract(creator string, cid string) *MsgCancelContract { + return &MsgCancelContract{ + Creator: creator, + Cid: cid, + } +} + +func (msg *MsgCancelContract) Route() string { + return RouterKey +} + +func (msg *MsgCancelContract) Type() string { + return TypeMsgCancelContract +} + +func (msg *MsgCancelContract) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgCancelContract) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgCancelContract) ValidateBasic() error { + prefix, _, err := bech32.DecodeAndConvert(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if prefix != addressPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jkl`", prefix)) + } + + prefix, _, err = bech32.DecodeAndConvert(msg.Cid) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid cid (%s)", err) + } + if prefix != cidPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid cid prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jklc`", prefix)) + } + return nil +} diff --git a/x/storage/types/message_cancel_contract_test.go b/x/storage/types/message_cancel_contract_test.go new file mode 100644 index 000000000..c0fc75301 --- /dev/null +++ b/x/storage/types/message_cancel_contract_test.go @@ -0,0 +1,48 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgCancelContract_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgCancelContract + err error + }{ + { + name: "invalid address", + msg: MsgCancelContract{ + Creator: "invalid_address", + Cid: "jklc1j3p63s42w7ywaczlju626st55mzu5z39qh6g4g", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "invalid cid", + msg: MsgCancelContract{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Cid: "invalid_cid", + }, + err: sdkerrors.ErrInvalidRequest, + }, { + name: "valid address", + msg: MsgCancelContract{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Cid: "jklc1j3p63s42w7ywaczlju626st55mzu5z39qh6g4g", + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/storage/types/message_claim_stray.go b/x/storage/types/message_claim_stray.go new file mode 100644 index 000000000..e1eca9cce --- /dev/null +++ b/x/storage/types/message_claim_stray.go @@ -0,0 +1,60 @@ +package types + +import ( + fmt "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgClaimStray = "claim_stray" + +var _ sdk.Msg = &MsgClaimStray{} + +func NewMsgClaimStray(creator string, cid string) *MsgClaimStray { + return &MsgClaimStray{ + Creator: creator, + Cid: cid, + } +} + +func (msg *MsgClaimStray) Route() string { + return RouterKey +} + +func (msg *MsgClaimStray) Type() string { + return TypeMsgClaimStray +} + +func (msg *MsgClaimStray) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgClaimStray) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgClaimStray) ValidateBasic() error { + prefix, _, err := bech32.DecodeAndConvert(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if prefix != addressPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jkl`", prefix)) + } + + prefix, _, err = bech32.DecodeAndConvert(msg.Cid) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid cid (%s)", err) + } + if prefix != cidPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid cid prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jklc`", prefix)) + } + return nil +} diff --git a/x/storage/types/message_claim_stray_test.go b/x/storage/types/message_claim_stray_test.go new file mode 100644 index 000000000..76660b92a --- /dev/null +++ b/x/storage/types/message_claim_stray_test.go @@ -0,0 +1,48 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgClaimStray_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgClaimStray + err error + }{ + { + name: "invalid address", + msg: MsgClaimStray{ + Creator: "invalid_address", + Cid: "jklc1j3p63s42w7ywaczlju626st55mzu5z39qh6g4g", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "invalid cid", + msg: MsgClaimStray{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Cid: "invalid_cid", + }, + err: sdkerrors.ErrInvalidRequest, + }, { + name: "valid address", + msg: MsgClaimStray{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Cid: "jklc1j3p63s42w7ywaczlju626st55mzu5z39qh6g4g", + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/storage/types/message_init_miner.go b/x/storage/types/message_init_miner.go new file mode 100644 index 000000000..e2f82f7de --- /dev/null +++ b/x/storage/types/message_init_miner.go @@ -0,0 +1,64 @@ +package types + +import ( + fmt "fmt" + "net/url" + "strconv" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgInitProvider = "init_provider" + +var _ sdk.Msg = &MsgInitProvider{} + +func NewMsgInitProvider(creator string, ip string, totalspace string) *MsgInitProvider { + return &MsgInitProvider{ + Creator: creator, + Ip: ip, + Totalspace: totalspace, + } +} + +func (msg *MsgInitProvider) Route() string { + return RouterKey +} + +func (msg *MsgInitProvider) Type() string { + return TypeMsgInitProvider +} + +func (msg *MsgInitProvider) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgInitProvider) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgInitProvider) ValidateBasic() error { + prefix, _, err := bech32.DecodeAndConvert(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if prefix != addressPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jkl`", prefix)) + } + + _, err = url.ParseRequestURI(msg.Ip) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "invalid provider ip (%s)", err) + } + + if _, err := strconv.Atoi(msg.Totalspace); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot parse totalspace (%s)", err) + } + return nil +} diff --git a/x/storage/types/message_init_miner_test.go b/x/storage/types/message_init_miner_test.go new file mode 100644 index 000000000..161e2cac2 --- /dev/null +++ b/x/storage/types/message_init_miner_test.go @@ -0,0 +1,66 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgInitProvider_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgInitProvider + err error + }{ + { + name: "invalid address", + msg: MsgInitProvider{ + Creator: "invalid_address", + Ip: "http://localhost:3333", + Totalspace: "1000000000", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "invalid ip", + msg: MsgInitProvider{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Ip: "fake/localhost:3333", + Totalspace: "1000000000", + }, + err: sdkerrors.ErrInvalidType, + }, { + name: "invalid totalspace", + msg: MsgInitProvider{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Ip: "https://node.jackalprotocol.com", + Totalspace: "abd", + }, + err: sdkerrors.ErrInvalidType, + }, { + name: "valid ip", + msg: MsgInitProvider{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Ip: "https://node.jackalprotocol.com", + Totalspace: "1000000000", + }, + }, { + name: "valid ip localhost", + msg: MsgInitProvider{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Ip: "localhost:3333", + Totalspace: "1000000000", + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/storage/types/message_post_contract.go b/x/storage/types/message_post_contract.go new file mode 100644 index 000000000..793b2046b --- /dev/null +++ b/x/storage/types/message_post_contract.go @@ -0,0 +1,77 @@ +package types + +import ( + fmt "fmt" + "strconv" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgPostContract = "post_contract" + +var _ sdk.Msg = &MsgPostContract{} + +func NewMsgPostContract(creator string, signee string, filesize string, fid string, merkle string) *MsgPostContract { + return &MsgPostContract{ + Creator: creator, + Signee: signee, + Filesize: filesize, + Fid: fid, + Merkle: merkle, + } +} + +func (msg *MsgPostContract) Route() string { + return RouterKey +} + +func (msg *MsgPostContract) Type() string { + return TypeMsgPostContract +} + +func (msg *MsgPostContract) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgPostContract) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgPostContract) ValidateBasic() error { + prefix, _, err := bech32.DecodeAndConvert(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if prefix != addressPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jkl`", prefix)) + } + + prefix, _, err = bech32.DecodeAndConvert(msg.Signee) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid signee address (%s)", err) + } + if prefix != addressPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid signee prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jkl`", prefix)) + } + + prefix, _, err = bech32.DecodeAndConvert(msg.Fid) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid fid (%s)", err) + } + if prefix != fidPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid fid prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jklf`", prefix)) + } + + if _, err := strconv.Atoi(msg.Filesize); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot parse file size (%s)", err) + } + + return nil +} diff --git a/x/storage/types/message_post_contract_test.go b/x/storage/types/message_post_contract_test.go new file mode 100644 index 000000000..3d9143613 --- /dev/null +++ b/x/storage/types/message_post_contract_test.go @@ -0,0 +1,77 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgPostContract_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgPostContract + err error + }{ + { + name: "invalid creator", + msg: MsgPostContract{ + Creator: "invalid_address", + Merkle: "merkle", + Signee: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Filesize: "100000", + Fid: "jklf1j3p63s42w7ywaczlju626st55mzu5z39w2rx9x", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "invalid signee", + msg: MsgPostContract{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Merkle: "merkle", + Signee: "invalid_address", + Filesize: "100000", + Fid: "jklf1j3p63s42w7ywaczlju626st55mzu5z39w2rx9x", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "invalid filesize", + msg: MsgPostContract{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Merkle: "merkle", + Signee: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Filesize: "x", + Fid: "jklf1j3p63s42w7ywaczlju626st55mzu5z39w2rx9x", + }, + err: sdkerrors.ErrInvalidType, + }, { + name: "invalid fid", + msg: MsgPostContract{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Merkle: "merkle", + Signee: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Filesize: "100000", + Fid: "invalid_fid", + }, + err: sdkerrors.ErrInvalidRequest, + }, { + name: "valid address", + msg: MsgPostContract{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Merkle: "merkle", + Signee: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Filesize: "100000", + Fid: "jklf1j3p63s42w7ywaczlju626st55mzu5z39w2rx9x", + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/storage/types/message_postproof.go b/x/storage/types/message_postproof.go new file mode 100644 index 000000000..13176e90c --- /dev/null +++ b/x/storage/types/message_postproof.go @@ -0,0 +1,62 @@ +package types + +import ( + fmt "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgPostproof = "postproof" + +var _ sdk.Msg = &MsgPostproof{} + +func NewMsgPostproof(creator string, item string, hashlist string, cid string) *MsgPostproof { + return &MsgPostproof{ + Creator: creator, + Cid: cid, + Item: item, + Hashlist: hashlist, + } +} + +func (msg *MsgPostproof) Route() string { + return RouterKey +} + +func (msg *MsgPostproof) Type() string { + return TypeMsgPostproof +} + +func (msg *MsgPostproof) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgPostproof) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgPostproof) ValidateBasic() error { + prefix, _, err := bech32.DecodeAndConvert(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if prefix != addressPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jkl`", prefix)) + } + + prefix, _, err = bech32.DecodeAndConvert(msg.Cid) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid cid (%s)", err) + } + if prefix != "jklc" { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid cid prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jklc`", prefix)) + } + return nil +} diff --git a/x/storage/types/message_postproof_test.go b/x/storage/types/message_postproof_test.go new file mode 100644 index 000000000..7e49a7a83 --- /dev/null +++ b/x/storage/types/message_postproof_test.go @@ -0,0 +1,54 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgPostproof_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgPostproof + err error + }{ + { + name: "invalid address", + msg: MsgPostproof{ + Creator: "invalid_address", + Item: "hex", + Hashlist: "hex", + Cid: "jklc1j3p63s42w7ywaczlju626st55mzu5z39qh6g4g", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "invalid cid", + msg: MsgPostproof{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Item: "hex", + Hashlist: "hex", + Cid: "invalid_cid", + }, + err: sdkerrors.ErrInvalidRequest, + }, { + name: "valid address", + msg: MsgPostproof{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Item: "hex", + Hashlist: "hex", + Cid: "jklc1j3p63s42w7ywaczlju626st55mzu5z39qh6g4g", + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/storage/types/message_set_miner_ip.go b/x/storage/types/message_set_miner_ip.go new file mode 100644 index 000000000..216ac3343 --- /dev/null +++ b/x/storage/types/message_set_miner_ip.go @@ -0,0 +1,59 @@ +package types + +import ( + fmt "fmt" + "net/url" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgSetProviderIP = "set_provider_ip" + +var _ sdk.Msg = &MsgSetProviderIP{} + +func NewMsgSetProviderIP(creator string, ip string) *MsgSetProviderIP { + return &MsgSetProviderIP{ + Creator: creator, + Ip: ip, + } +} + +func (msg *MsgSetProviderIP) Route() string { + return RouterKey +} + +func (msg *MsgSetProviderIP) Type() string { + return TypeMsgSetProviderIP +} + +func (msg *MsgSetProviderIP) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgSetProviderIP) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgSetProviderIP) ValidateBasic() error { + prefix, _, err := bech32.DecodeAndConvert(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if prefix != addressPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jkl`", prefix)) + } + + _, err = url.ParseRequestURI(msg.Ip) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "invalid provider ip (%s)", err) + } + + return nil +} diff --git a/x/storage/types/message_set_miner_ip_test.go b/x/storage/types/message_set_miner_ip_test.go new file mode 100644 index 000000000..e8351cb7b --- /dev/null +++ b/x/storage/types/message_set_miner_ip_test.go @@ -0,0 +1,54 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgSetProviderIP_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgSetProviderIP + err error + }{ + { + name: "invalid address", + msg: MsgSetProviderIP{ + Creator: "invalid_address", + Ip: "http://localhost:3333", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "invalid ip", + msg: MsgSetProviderIP{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Ip: "fake/localhost:3333", + }, + err: sdkerrors.ErrInvalidType, + }, { + name: "valid ip", + msg: MsgSetProviderIP{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Ip: "https://node.jackalprotocol.com", + }, + }, { + name: "valid ip localhost", + msg: MsgSetProviderIP{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Ip: "localhost:3333", + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/storage/types/message_set_miner_totalspace.go b/x/storage/types/message_set_miner_totalspace.go new file mode 100644 index 000000000..d016ceda9 --- /dev/null +++ b/x/storage/types/message_set_miner_totalspace.go @@ -0,0 +1,57 @@ +package types + +import ( + fmt "fmt" + "strconv" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgSetProviderTotalspace = "set_provider_totalspace" + +var _ sdk.Msg = &MsgSetProviderTotalspace{} + +func NewMsgSetProviderTotalspace(creator string, space string) *MsgSetProviderTotalspace { + return &MsgSetProviderTotalspace{ + Creator: creator, + Space: space, + } +} + +func (msg *MsgSetProviderTotalspace) Route() string { + return RouterKey +} + +func (msg *MsgSetProviderTotalspace) Type() string { + return TypeMsgSetProviderTotalspace +} + +func (msg *MsgSetProviderTotalspace) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgSetProviderTotalspace) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgSetProviderTotalspace) ValidateBasic() error { + prefix, _, err := bech32.DecodeAndConvert(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if prefix != addressPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jkl`", prefix)) + } + + if _, err := strconv.Atoi(msg.Space); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot parse space (%s)", err) + } + return nil +} diff --git a/x/storage/types/message_set_miner_totalspace_test.go b/x/storage/types/message_set_miner_totalspace_test.go new file mode 100644 index 000000000..287e4abbf --- /dev/null +++ b/x/storage/types/message_set_miner_totalspace_test.go @@ -0,0 +1,48 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgSetProviderTotalspace_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgSetProviderTotalspace + err error + }{ + { + name: "invalid address", + msg: MsgSetProviderTotalspace{ + Creator: "invalid_address", + Space: "1000000000", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "invalid ip", + msg: MsgSetProviderTotalspace{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Space: "abd", + }, + err: sdkerrors.ErrInvalidType, + }, { + name: "valid ip", + msg: MsgSetProviderTotalspace{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Space: "1000000000", + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/storage/types/message_sign_contract.go b/x/storage/types/message_sign_contract.go new file mode 100644 index 000000000..3aa66d4a4 --- /dev/null +++ b/x/storage/types/message_sign_contract.go @@ -0,0 +1,60 @@ +package types + +import ( + fmt "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgSignContract = "sign_contract" + +var _ sdk.Msg = &MsgSignContract{} + +func NewMsgSignContract(creator string, cid string) *MsgSignContract { + return &MsgSignContract{ + Creator: creator, + Cid: cid, + } +} + +func (msg *MsgSignContract) Route() string { + return RouterKey +} + +func (msg *MsgSignContract) Type() string { + return TypeMsgSignContract +} + +func (msg *MsgSignContract) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgSignContract) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgSignContract) ValidateBasic() error { + prefix, _, err := bech32.DecodeAndConvert(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if prefix != addressPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jkl`", prefix)) + } + + prefix, _, err = bech32.DecodeAndConvert(msg.Cid) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid cid (%s)", err) + } + if prefix != cidPrefix { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid cid prefix (%s)", fmt.Errorf("%s is not a valid prefix here. Expected `jklc`", prefix)) + } + return nil +} diff --git a/x/storage/types/message_sign_contract_test.go b/x/storage/types/message_sign_contract_test.go new file mode 100644 index 000000000..2e2bda9bd --- /dev/null +++ b/x/storage/types/message_sign_contract_test.go @@ -0,0 +1,48 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgSignContract_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgSignContract + err error + }{ + { + name: "invalid address", + msg: MsgSignContract{ + Creator: "invalid_address", + Cid: "jklc1j3p63s42w7ywaczlju626st55mzu5z39qh6g4g", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "invalid cid", + msg: MsgSignContract{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Cid: "invalid_cid", + }, + err: sdkerrors.ErrInvalidRequest, + }, { + name: "valid address", + msg: MsgSignContract{ + Creator: "jkl1j3p63s42w7ywaczlju626st55mzu5z399f5n6n", + Cid: "jklc1j3p63s42w7ywaczlju626st55mzu5z39qh6g4g", + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/storage/types/params.go b/x/storage/types/params.go new file mode 100644 index 000000000..357196ad6 --- /dev/null +++ b/x/storage/types/params.go @@ -0,0 +1,39 @@ +package types + +import ( + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "gopkg.in/yaml.v2" +) + +var _ paramtypes.ParamSet = (*Params)(nil) + +// ParamKeyTable the param key table for launch module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance +func NewParams() Params { + return Params{} +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams() +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{} +} + +// Validate validates the set of params +func (p Params) Validate() error { + return nil +} + +// String implements the Stringer interface. +func (p Params) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} diff --git a/x/storage/types/params.pb.go b/x/storage/types/params.pb.go new file mode 100644 index 000000000..7ef7d6f94 --- /dev/null +++ b/x/storage/types/params.pb.go @@ -0,0 +1,265 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: canine-chain/storage/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/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 + +// Params defines the parameters for the module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_8172b382e937def3, []int{0} +} +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 + +func init() { + proto.RegisterType((*Params)(nil), "jackaldao.canine.storage.Params") +} + +func init() { proto.RegisterFile("canine-chain/storage/params.proto", fileDescriptor_8172b382e937def3) } + +var fileDescriptor_8172b382e937def3 = []byte{ + // 166 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0x4e, 0xcc, 0xcb, + 0xcc, 0x4b, 0xd5, 0x4d, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x2f, 0x2e, 0xc9, 0x2f, 0x4a, 0x4c, 0x4f, + 0xd5, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xc8, + 0x4a, 0x4c, 0xce, 0x4e, 0xcc, 0x49, 0x49, 0xcc, 0xd7, 0x83, 0x28, 0xd6, 0x83, 0x2a, 0x93, 0x12, + 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, 0xd2, 0x07, 0xb1, 0x20, 0xea, 0x95, 0xf8, 0xb8, 0xd8, 0x02, + 0xc0, 0xfa, 0xad, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0x72, 0x3b, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, + 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, + 0xc6, 0x63, 0x39, 0x86, 0x28, 0x9d, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, + 0x7d, 0x88, 0x25, 0xba, 0x29, 0x89, 0xf9, 0xfa, 0x10, 0x5b, 0xf4, 0x2b, 0xe0, 0xce, 0x29, 0xa9, + 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x1b, 0x6f, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xda, + 0x7a, 0x20, 0xb3, 0x00, 0x00, 0x00, +} + +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 + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +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 ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + 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 { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/storage/types/pay_blocks.pb.go b/x/storage/types/pay_blocks.pb.go new file mode 100644 index 000000000..6570033bd --- /dev/null +++ b/x/storage/types/pay_blocks.pb.go @@ -0,0 +1,473 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: canine-chain/storage/pay_blocks.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type PayBlocks struct { + Blockid string `protobuf:"bytes,1,opt,name=blockid,proto3" json:"blockid,omitempty"` + Bytes string `protobuf:"bytes,2,opt,name=bytes,proto3" json:"bytes,omitempty"` + Blocktype string `protobuf:"bytes,3,opt,name=blocktype,proto3" json:"blocktype,omitempty"` + Blocknum string `protobuf:"bytes,4,opt,name=blocknum,proto3" json:"blocknum,omitempty"` +} + +func (m *PayBlocks) Reset() { *m = PayBlocks{} } +func (m *PayBlocks) String() string { return proto.CompactTextString(m) } +func (*PayBlocks) ProtoMessage() {} +func (*PayBlocks) Descriptor() ([]byte, []int) { + return fileDescriptor_afcab5148682d329, []int{0} +} +func (m *PayBlocks) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PayBlocks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PayBlocks.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PayBlocks) XXX_Merge(src proto.Message) { + xxx_messageInfo_PayBlocks.Merge(m, src) +} +func (m *PayBlocks) XXX_Size() int { + return m.Size() +} +func (m *PayBlocks) XXX_DiscardUnknown() { + xxx_messageInfo_PayBlocks.DiscardUnknown(m) +} + +var xxx_messageInfo_PayBlocks proto.InternalMessageInfo + +func (m *PayBlocks) GetBlockid() string { + if m != nil { + return m.Blockid + } + return "" +} + +func (m *PayBlocks) GetBytes() string { + if m != nil { + return m.Bytes + } + return "" +} + +func (m *PayBlocks) GetBlocktype() string { + if m != nil { + return m.Blocktype + } + return "" +} + +func (m *PayBlocks) GetBlocknum() string { + if m != nil { + return m.Blocknum + } + return "" +} + +func init() { + proto.RegisterType((*PayBlocks)(nil), "jackaldao.canine.storage.PayBlocks") +} + +func init() { + proto.RegisterFile("canine-chain/storage/pay_blocks.proto", fileDescriptor_afcab5148682d329) +} + +var fileDescriptor_afcab5148682d329 = []byte{ + // 214 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0x4e, 0xcc, 0xcb, + 0xcc, 0x4b, 0xd5, 0x4d, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x2f, 0x2e, 0xc9, 0x2f, 0x4a, 0x4c, 0x4f, + 0xd5, 0x2f, 0x48, 0xac, 0x8c, 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0x2e, 0xd6, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0x92, 0xc8, 0x4a, 0x4c, 0xce, 0x4e, 0xcc, 0x49, 0x49, 0xcc, 0xd7, 0x83, 0x68, 0xd0, + 0x83, 0x2a, 0x55, 0x2a, 0xe5, 0xe2, 0x0c, 0x48, 0xac, 0x74, 0x02, 0x2b, 0x16, 0x92, 0xe0, 0x62, + 0x07, 0x6b, 0xcb, 0x4c, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0x71, 0x85, 0x44, 0xb8, + 0x58, 0x93, 0x2a, 0x4b, 0x52, 0x8b, 0x25, 0x98, 0xc0, 0xe2, 0x10, 0x8e, 0x90, 0x0c, 0x17, 0x27, + 0x58, 0x41, 0x49, 0x65, 0x41, 0xaa, 0x04, 0x33, 0x58, 0x06, 0x21, 0x20, 0x24, 0xc5, 0xc5, 0x01, + 0xe6, 0xe4, 0x95, 0xe6, 0x4a, 0xb0, 0x80, 0x25, 0xe1, 0x7c, 0x27, 0xb7, 0x13, 0x8f, 0xe4, 0x18, + 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, + 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, + 0xcf, 0xd5, 0x87, 0xb8, 0x5a, 0x37, 0x25, 0x31, 0x5f, 0x1f, 0xe2, 0x6c, 0xfd, 0x0a, 0xb8, 0x1f, + 0x41, 0x56, 0x14, 0x27, 0xb1, 0x81, 0xfd, 0x67, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xac, 0x07, + 0x87, 0x07, 0x08, 0x01, 0x00, 0x00, +} + +func (m *PayBlocks) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PayBlocks) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PayBlocks) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Blocknum) > 0 { + i -= len(m.Blocknum) + copy(dAtA[i:], m.Blocknum) + i = encodeVarintPayBlocks(dAtA, i, uint64(len(m.Blocknum))) + i-- + dAtA[i] = 0x22 + } + if len(m.Blocktype) > 0 { + i -= len(m.Blocktype) + copy(dAtA[i:], m.Blocktype) + i = encodeVarintPayBlocks(dAtA, i, uint64(len(m.Blocktype))) + i-- + dAtA[i] = 0x1a + } + if len(m.Bytes) > 0 { + i -= len(m.Bytes) + copy(dAtA[i:], m.Bytes) + i = encodeVarintPayBlocks(dAtA, i, uint64(len(m.Bytes))) + i-- + dAtA[i] = 0x12 + } + if len(m.Blockid) > 0 { + i -= len(m.Blockid) + copy(dAtA[i:], m.Blockid) + i = encodeVarintPayBlocks(dAtA, i, uint64(len(m.Blockid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintPayBlocks(dAtA []byte, offset int, v uint64) int { + offset -= sovPayBlocks(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PayBlocks) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Blockid) + if l > 0 { + n += 1 + l + sovPayBlocks(uint64(l)) + } + l = len(m.Bytes) + if l > 0 { + n += 1 + l + sovPayBlocks(uint64(l)) + } + l = len(m.Blocktype) + if l > 0 { + n += 1 + l + sovPayBlocks(uint64(l)) + } + l = len(m.Blocknum) + if l > 0 { + n += 1 + l + sovPayBlocks(uint64(l)) + } + return n +} + +func sovPayBlocks(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPayBlocks(x uint64) (n int) { + return sovPayBlocks(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PayBlocks) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPayBlocks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PayBlocks: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PayBlocks: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blockid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPayBlocks + } + 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 ErrInvalidLengthPayBlocks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPayBlocks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blockid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPayBlocks + } + 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 ErrInvalidLengthPayBlocks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPayBlocks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bytes = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blocktype", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPayBlocks + } + 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 ErrInvalidLengthPayBlocks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPayBlocks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blocktype = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blocknum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPayBlocks + } + 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 ErrInvalidLengthPayBlocks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPayBlocks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blocknum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPayBlocks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPayBlocks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPayBlocks(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, ErrIntOverflowPayBlocks + } + 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, ErrIntOverflowPayBlocks + } + 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, ErrIntOverflowPayBlocks + } + 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, ErrInvalidLengthPayBlocks + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPayBlocks + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPayBlocks + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPayBlocks = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPayBlocks = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPayBlocks = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/storage/types/proofs.pb.go b/x/storage/types/proofs.pb.go new file mode 100644 index 000000000..583d9c540 --- /dev/null +++ b/x/storage/types/proofs.pb.go @@ -0,0 +1,471 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: canine-chain/storage/proofs.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Proofs struct { + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` + Item string `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` + Hashes string `protobuf:"bytes,3,opt,name=hashes,proto3" json:"hashes,omitempty"` + Creator string `protobuf:"bytes,4,opt,name=creator,proto3" json:"creator,omitempty"` +} + +func (m *Proofs) Reset() { *m = Proofs{} } +func (m *Proofs) String() string { return proto.CompactTextString(m) } +func (*Proofs) ProtoMessage() {} +func (*Proofs) Descriptor() ([]byte, []int) { + return fileDescriptor_ed3a146f00011c4b, []int{0} +} +func (m *Proofs) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Proofs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Proofs.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Proofs) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proofs.Merge(m, src) +} +func (m *Proofs) XXX_Size() int { + return m.Size() +} +func (m *Proofs) XXX_DiscardUnknown() { + xxx_messageInfo_Proofs.DiscardUnknown(m) +} + +var xxx_messageInfo_Proofs proto.InternalMessageInfo + +func (m *Proofs) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +func (m *Proofs) GetItem() string { + if m != nil { + return m.Item + } + return "" +} + +func (m *Proofs) GetHashes() string { + if m != nil { + return m.Hashes + } + return "" +} + +func (m *Proofs) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func init() { + proto.RegisterType((*Proofs)(nil), "jackaldao.canine.storage.Proofs") +} + +func init() { proto.RegisterFile("canine-chain/storage/proofs.proto", fileDescriptor_ed3a146f00011c4b) } + +var fileDescriptor_ed3a146f00011c4b = []byte{ + // 209 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0x4e, 0xcc, 0xcb, + 0xcc, 0x4b, 0xd5, 0x4d, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x2f, 0x2e, 0xc9, 0x2f, 0x4a, 0x4c, 0x4f, + 0xd5, 0x2f, 0x28, 0xca, 0xcf, 0x4f, 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xc8, + 0x4a, 0x4c, 0xce, 0x4e, 0xcc, 0x49, 0x49, 0xcc, 0xd7, 0x83, 0x28, 0xd6, 0x83, 0x2a, 0x53, 0x4a, + 0xe0, 0x62, 0x0b, 0x00, 0xab, 0x14, 0x12, 0xe0, 0x62, 0x4e, 0xce, 0x4c, 0x91, 0x60, 0x54, 0x60, + 0xd4, 0xe0, 0x0c, 0x02, 0x31, 0x85, 0x84, 0xb8, 0x58, 0x32, 0x4b, 0x52, 0x73, 0x25, 0x98, 0xc0, + 0x42, 0x60, 0xb6, 0x90, 0x18, 0x17, 0x5b, 0x46, 0x62, 0x71, 0x46, 0x6a, 0xb1, 0x04, 0x33, 0x58, + 0x14, 0xca, 0x13, 0x92, 0xe0, 0x62, 0x4f, 0x2e, 0x4a, 0x4d, 0x2c, 0xc9, 0x2f, 0x92, 0x60, 0x01, + 0x4b, 0xc0, 0xb8, 0x4e, 0x6e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, + 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, + 0x93, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x71, 0xa0, 0x6e, 0x4a, + 0x62, 0xbe, 0x3e, 0xc4, 0x85, 0xfa, 0x15, 0x70, 0xaf, 0x94, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, + 0x81, 0xbd, 0x62, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x89, 0xd2, 0xd4, 0x9c, 0xef, 0x00, 0x00, + 0x00, +} + +func (m *Proofs) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Proofs) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Proofs) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintProofs(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0x22 + } + if len(m.Hashes) > 0 { + i -= len(m.Hashes) + copy(dAtA[i:], m.Hashes) + i = encodeVarintProofs(dAtA, i, uint64(len(m.Hashes))) + i-- + dAtA[i] = 0x1a + } + if len(m.Item) > 0 { + i -= len(m.Item) + copy(dAtA[i:], m.Item) + i = encodeVarintProofs(dAtA, i, uint64(len(m.Item))) + i-- + dAtA[i] = 0x12 + } + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintProofs(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintProofs(dAtA []byte, offset int, v uint64) int { + offset -= sovProofs(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Proofs) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovProofs(uint64(l)) + } + l = len(m.Item) + if l > 0 { + n += 1 + l + sovProofs(uint64(l)) + } + l = len(m.Hashes) + if l > 0 { + n += 1 + l + sovProofs(uint64(l)) + } + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovProofs(uint64(l)) + } + return n +} + +func sovProofs(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozProofs(x uint64) (n int) { + return sovProofs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Proofs) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProofs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Proofs: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Proofs: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProofs + } + 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 ErrInvalidLengthProofs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProofs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Item", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProofs + } + 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 ErrInvalidLengthProofs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProofs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Item = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hashes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProofs + } + 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 ErrInvalidLengthProofs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProofs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hashes = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowProofs + } + 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 ErrInvalidLengthProofs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProofs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProofs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProofs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipProofs(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, ErrIntOverflowProofs + } + 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, ErrIntOverflowProofs + } + 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, ErrIntOverflowProofs + } + 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, ErrInvalidLengthProofs + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupProofs + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthProofs + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthProofs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowProofs = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupProofs = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/storage/types/providers.pb.go b/x/storage/types/providers.pb.go new file mode 100644 index 000000000..ee9cb0373 --- /dev/null +++ b/x/storage/types/providers.pb.go @@ -0,0 +1,526 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: canine-chain/storage/providers.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Providers struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` + Totalspace string `protobuf:"bytes,3,opt,name=totalspace,proto3" json:"totalspace,omitempty"` + BurnedContracts string `protobuf:"bytes,4,opt,name=burned_contracts,json=burnedContracts,proto3" json:"burned_contracts,omitempty"` + Creator string `protobuf:"bytes,5,opt,name=creator,proto3" json:"creator,omitempty"` +} + +func (m *Providers) Reset() { *m = Providers{} } +func (m *Providers) String() string { return proto.CompactTextString(m) } +func (*Providers) ProtoMessage() {} +func (*Providers) Descriptor() ([]byte, []int) { + return fileDescriptor_a9ab372012af4e4c, []int{0} +} +func (m *Providers) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Providers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Providers.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Providers) XXX_Merge(src proto.Message) { + xxx_messageInfo_Providers.Merge(m, src) +} +func (m *Providers) XXX_Size() int { + return m.Size() +} +func (m *Providers) XXX_DiscardUnknown() { + xxx_messageInfo_Providers.DiscardUnknown(m) +} + +var xxx_messageInfo_Providers proto.InternalMessageInfo + +func (m *Providers) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Providers) GetIp() string { + if m != nil { + return m.Ip + } + return "" +} + +func (m *Providers) GetTotalspace() string { + if m != nil { + return m.Totalspace + } + return "" +} + +func (m *Providers) GetBurnedContracts() string { + if m != nil { + return m.BurnedContracts + } + return "" +} + +func (m *Providers) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func init() { + proto.RegisterType((*Providers)(nil), "jackaldao.canine.storage.Providers") +} + +func init() { + proto.RegisterFile("canine-chain/storage/providers.proto", fileDescriptor_a9ab372012af4e4c) +} + +var fileDescriptor_a9ab372012af4e4c = []byte{ + // 241 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xbd, 0x4a, 0x04, 0x31, + 0x14, 0x85, 0x27, 0xe3, 0x1f, 0x9b, 0x42, 0x25, 0x55, 0xaa, 0x20, 0x62, 0xa1, 0xe0, 0x4e, 0x0a, + 0xdf, 0x40, 0xc1, 0x5a, 0x2c, 0x6d, 0xe4, 0x4e, 0x12, 0x76, 0xa3, 0x6b, 0x6e, 0x48, 0xee, 0x8a, + 0xbe, 0x85, 0xb5, 0x4f, 0x64, 0xb9, 0xa5, 0xa5, 0xcc, 0xbc, 0x88, 0x38, 0x99, 0x91, 0x2d, 0xcf, + 0xc7, 0x07, 0x87, 0x73, 0xf8, 0x99, 0x81, 0xe0, 0x83, 0x9b, 0x9b, 0x25, 0xf8, 0xa0, 0x33, 0x61, + 0x82, 0x85, 0xd3, 0x31, 0xe1, 0xab, 0xb7, 0x2e, 0xe5, 0x26, 0x26, 0x24, 0x14, 0xf2, 0x09, 0xcc, + 0x33, 0xac, 0x2c, 0x60, 0x53, 0xfc, 0x66, 0x34, 0x4f, 0x3f, 0x19, 0x9f, 0xdd, 0x4d, 0xb6, 0x90, + 0xfc, 0x00, 0xac, 0x4d, 0x2e, 0x67, 0xc9, 0x4e, 0xd8, 0xf9, 0xec, 0x7e, 0x8a, 0xe2, 0x90, 0xd7, + 0x3e, 0xca, 0x7a, 0x80, 0xb5, 0x8f, 0x42, 0x71, 0x4e, 0x48, 0xb0, 0xca, 0x11, 0x8c, 0x93, 0x3b, + 0x03, 0xdf, 0x22, 0xe2, 0x82, 0x1f, 0xb7, 0xeb, 0x14, 0x9c, 0x7d, 0x34, 0x18, 0x28, 0x81, 0xa1, + 0x2c, 0x77, 0x07, 0xeb, 0xa8, 0xf0, 0x9b, 0x09, 0xff, 0x95, 0x9a, 0xe4, 0x80, 0x30, 0xc9, 0xbd, + 0x52, 0x3a, 0xc6, 0xeb, 0xdb, 0xaf, 0x4e, 0xb1, 0x4d, 0xa7, 0xd8, 0x4f, 0xa7, 0xd8, 0x47, 0xaf, + 0xaa, 0x4d, 0xaf, 0xaa, 0xef, 0x5e, 0x55, 0x0f, 0x97, 0x0b, 0x4f, 0xcb, 0x75, 0xdb, 0x18, 0x7c, + 0xd1, 0x65, 0xdb, 0xdc, 0x02, 0xea, 0x32, 0x4e, 0xbf, 0xfd, 0x1f, 0x41, 0xef, 0xd1, 0xe5, 0x76, + 0x7f, 0x78, 0xe1, 0xea, 0x37, 0x00, 0x00, 0xff, 0xff, 0xd3, 0x6d, 0xc8, 0x22, 0x2d, 0x01, 0x00, + 0x00, +} + +func (m *Providers) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Providers) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Providers) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintProviders(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0x2a + } + if len(m.BurnedContracts) > 0 { + i -= len(m.BurnedContracts) + copy(dAtA[i:], m.BurnedContracts) + i = encodeVarintProviders(dAtA, i, uint64(len(m.BurnedContracts))) + i-- + dAtA[i] = 0x22 + } + if len(m.Totalspace) > 0 { + i -= len(m.Totalspace) + copy(dAtA[i:], m.Totalspace) + i = encodeVarintProviders(dAtA, i, uint64(len(m.Totalspace))) + i-- + dAtA[i] = 0x1a + } + if len(m.Ip) > 0 { + i -= len(m.Ip) + copy(dAtA[i:], m.Ip) + i = encodeVarintProviders(dAtA, i, uint64(len(m.Ip))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintProviders(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintProviders(dAtA []byte, offset int, v uint64) int { + offset -= sovProviders(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Providers) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovProviders(uint64(l)) + } + l = len(m.Ip) + if l > 0 { + n += 1 + l + sovProviders(uint64(l)) + } + l = len(m.Totalspace) + if l > 0 { + n += 1 + l + sovProviders(uint64(l)) + } + l = len(m.BurnedContracts) + if l > 0 { + n += 1 + l + sovProviders(uint64(l)) + } + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovProviders(uint64(l)) + } + return n +} + +func sovProviders(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozProviders(x uint64) (n int) { + return sovProviders(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Providers) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProviders + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Providers: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Providers: 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 ErrIntOverflowProviders + } + 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 ErrInvalidLengthProviders + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProviders + } + 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 Ip", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProviders + } + 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 ErrInvalidLengthProviders + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProviders + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ip = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Totalspace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProviders + } + 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 ErrInvalidLengthProviders + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProviders + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Totalspace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BurnedContracts", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProviders + } + 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 ErrInvalidLengthProviders + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProviders + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BurnedContracts = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + 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 ErrIntOverflowProviders + } + 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 ErrInvalidLengthProviders + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProviders + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProviders(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProviders + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipProviders(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, ErrIntOverflowProviders + } + 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, ErrIntOverflowProviders + } + 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, ErrIntOverflowProviders + } + 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, ErrInvalidLengthProviders + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupProviders + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthProviders + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthProviders = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowProviders = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupProviders = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/storage/types/query.pb.go b/x/storage/types/query.pb.go new file mode 100644 index 000000000..9f1b26ab9 --- /dev/null +++ b/x/storage/types/query.pb.go @@ -0,0 +1,8008 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: canine-chain/storage/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +type QueryGetContractsRequest struct { + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` +} + +func (m *QueryGetContractsRequest) Reset() { *m = QueryGetContractsRequest{} } +func (m *QueryGetContractsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetContractsRequest) ProtoMessage() {} +func (*QueryGetContractsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{2} +} +func (m *QueryGetContractsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetContractsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetContractsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetContractsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetContractsRequest.Merge(m, src) +} +func (m *QueryGetContractsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetContractsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetContractsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetContractsRequest proto.InternalMessageInfo + +func (m *QueryGetContractsRequest) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +type QueryGetContractsResponse struct { + Contracts Contracts `protobuf:"bytes,1,opt,name=contracts,proto3" json:"contracts"` +} + +func (m *QueryGetContractsResponse) Reset() { *m = QueryGetContractsResponse{} } +func (m *QueryGetContractsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetContractsResponse) ProtoMessage() {} +func (*QueryGetContractsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{3} +} +func (m *QueryGetContractsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetContractsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetContractsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetContractsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetContractsResponse.Merge(m, src) +} +func (m *QueryGetContractsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetContractsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetContractsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetContractsResponse proto.InternalMessageInfo + +func (m *QueryGetContractsResponse) GetContracts() Contracts { + if m != nil { + return m.Contracts + } + return Contracts{} +} + +type QueryAllContractsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllContractsRequest) Reset() { *m = QueryAllContractsRequest{} } +func (m *QueryAllContractsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllContractsRequest) ProtoMessage() {} +func (*QueryAllContractsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{4} +} +func (m *QueryAllContractsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllContractsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllContractsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllContractsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllContractsRequest.Merge(m, src) +} +func (m *QueryAllContractsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllContractsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllContractsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllContractsRequest proto.InternalMessageInfo + +func (m *QueryAllContractsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllContractsResponse struct { + Contracts []Contracts `protobuf:"bytes,1,rep,name=contracts,proto3" json:"contracts"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllContractsResponse) Reset() { *m = QueryAllContractsResponse{} } +func (m *QueryAllContractsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllContractsResponse) ProtoMessage() {} +func (*QueryAllContractsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{5} +} +func (m *QueryAllContractsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllContractsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllContractsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllContractsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllContractsResponse.Merge(m, src) +} +func (m *QueryAllContractsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllContractsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllContractsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllContractsResponse proto.InternalMessageInfo + +func (m *QueryAllContractsResponse) GetContracts() []Contracts { + if m != nil { + return m.Contracts + } + return nil +} + +func (m *QueryAllContractsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetActiveDealsRequest struct { + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` +} + +func (m *QueryGetActiveDealsRequest) Reset() { *m = QueryGetActiveDealsRequest{} } +func (m *QueryGetActiveDealsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetActiveDealsRequest) ProtoMessage() {} +func (*QueryGetActiveDealsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{6} +} +func (m *QueryGetActiveDealsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetActiveDealsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetActiveDealsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetActiveDealsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetActiveDealsRequest.Merge(m, src) +} +func (m *QueryGetActiveDealsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetActiveDealsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetActiveDealsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetActiveDealsRequest proto.InternalMessageInfo + +func (m *QueryGetActiveDealsRequest) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +type QueryGetActiveDealsResponse struct { + ActiveDeals ActiveDeals `protobuf:"bytes,1,opt,name=activeDeals,proto3" json:"activeDeals"` +} + +func (m *QueryGetActiveDealsResponse) Reset() { *m = QueryGetActiveDealsResponse{} } +func (m *QueryGetActiveDealsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetActiveDealsResponse) ProtoMessage() {} +func (*QueryGetActiveDealsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{7} +} +func (m *QueryGetActiveDealsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetActiveDealsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetActiveDealsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetActiveDealsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetActiveDealsResponse.Merge(m, src) +} +func (m *QueryGetActiveDealsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetActiveDealsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetActiveDealsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetActiveDealsResponse proto.InternalMessageInfo + +func (m *QueryGetActiveDealsResponse) GetActiveDeals() ActiveDeals { + if m != nil { + return m.ActiveDeals + } + return ActiveDeals{} +} + +type QueryAllActiveDealsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllActiveDealsRequest) Reset() { *m = QueryAllActiveDealsRequest{} } +func (m *QueryAllActiveDealsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllActiveDealsRequest) ProtoMessage() {} +func (*QueryAllActiveDealsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{8} +} +func (m *QueryAllActiveDealsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllActiveDealsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllActiveDealsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllActiveDealsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllActiveDealsRequest.Merge(m, src) +} +func (m *QueryAllActiveDealsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllActiveDealsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllActiveDealsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllActiveDealsRequest proto.InternalMessageInfo + +func (m *QueryAllActiveDealsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllActiveDealsResponse struct { + ActiveDeals []ActiveDeals `protobuf:"bytes,1,rep,name=activeDeals,proto3" json:"activeDeals"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllActiveDealsResponse) Reset() { *m = QueryAllActiveDealsResponse{} } +func (m *QueryAllActiveDealsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllActiveDealsResponse) ProtoMessage() {} +func (*QueryAllActiveDealsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{9} +} +func (m *QueryAllActiveDealsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllActiveDealsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllActiveDealsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllActiveDealsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllActiveDealsResponse.Merge(m, src) +} +func (m *QueryAllActiveDealsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllActiveDealsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllActiveDealsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllActiveDealsResponse proto.InternalMessageInfo + +func (m *QueryAllActiveDealsResponse) GetActiveDeals() []ActiveDeals { + if m != nil { + return m.ActiveDeals + } + return nil +} + +func (m *QueryAllActiveDealsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetProvidersRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryGetProvidersRequest) Reset() { *m = QueryGetProvidersRequest{} } +func (m *QueryGetProvidersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetProvidersRequest) ProtoMessage() {} +func (*QueryGetProvidersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{10} +} +func (m *QueryGetProvidersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetProvidersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetProvidersRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetProvidersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetProvidersRequest.Merge(m, src) +} +func (m *QueryGetProvidersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetProvidersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetProvidersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetProvidersRequest proto.InternalMessageInfo + +func (m *QueryGetProvidersRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type QueryGetProvidersResponse struct { + Providers Providers `protobuf:"bytes,1,opt,name=providers,proto3" json:"providers"` +} + +func (m *QueryGetProvidersResponse) Reset() { *m = QueryGetProvidersResponse{} } +func (m *QueryGetProvidersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetProvidersResponse) ProtoMessage() {} +func (*QueryGetProvidersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{11} +} +func (m *QueryGetProvidersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetProvidersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetProvidersResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetProvidersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetProvidersResponse.Merge(m, src) +} +func (m *QueryGetProvidersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetProvidersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetProvidersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetProvidersResponse proto.InternalMessageInfo + +func (m *QueryGetProvidersResponse) GetProviders() Providers { + if m != nil { + return m.Providers + } + return Providers{} +} + +type QueryAllProvidersRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllProvidersRequest) Reset() { *m = QueryAllProvidersRequest{} } +func (m *QueryAllProvidersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllProvidersRequest) ProtoMessage() {} +func (*QueryAllProvidersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{12} +} +func (m *QueryAllProvidersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllProvidersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllProvidersRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllProvidersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllProvidersRequest.Merge(m, src) +} +func (m *QueryAllProvidersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllProvidersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllProvidersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllProvidersRequest proto.InternalMessageInfo + +func (m *QueryAllProvidersRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllProvidersResponse struct { + Providers []Providers `protobuf:"bytes,1,rep,name=providers,proto3" json:"providers"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllProvidersResponse) Reset() { *m = QueryAllProvidersResponse{} } +func (m *QueryAllProvidersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllProvidersResponse) ProtoMessage() {} +func (*QueryAllProvidersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{13} +} +func (m *QueryAllProvidersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllProvidersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllProvidersResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllProvidersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllProvidersResponse.Merge(m, src) +} +func (m *QueryAllProvidersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllProvidersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllProvidersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllProvidersResponse proto.InternalMessageInfo + +func (m *QueryAllProvidersResponse) GetProviders() []Providers { + if m != nil { + return m.Providers + } + return nil +} + +func (m *QueryAllProvidersResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryFreespaceRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryFreespaceRequest) Reset() { *m = QueryFreespaceRequest{} } +func (m *QueryFreespaceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryFreespaceRequest) ProtoMessage() {} +func (*QueryFreespaceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{14} +} +func (m *QueryFreespaceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFreespaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFreespaceRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFreespaceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFreespaceRequest.Merge(m, src) +} +func (m *QueryFreespaceRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryFreespaceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFreespaceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFreespaceRequest proto.InternalMessageInfo + +func (m *QueryFreespaceRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type QueryFreespaceResponse struct { + Space string `protobuf:"bytes,1,opt,name=space,proto3" json:"space,omitempty"` +} + +func (m *QueryFreespaceResponse) Reset() { *m = QueryFreespaceResponse{} } +func (m *QueryFreespaceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryFreespaceResponse) ProtoMessage() {} +func (*QueryFreespaceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{15} +} +func (m *QueryFreespaceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFreespaceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFreespaceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFreespaceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFreespaceResponse.Merge(m, src) +} +func (m *QueryFreespaceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryFreespaceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFreespaceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFreespaceResponse proto.InternalMessageInfo + +func (m *QueryFreespaceResponse) GetSpace() string { + if m != nil { + return m.Space + } + return "" +} + +type QueryFindFileRequest struct { + Fid string `protobuf:"bytes,1,opt,name=fid,proto3" json:"fid,omitempty"` +} + +func (m *QueryFindFileRequest) Reset() { *m = QueryFindFileRequest{} } +func (m *QueryFindFileRequest) String() string { return proto.CompactTextString(m) } +func (*QueryFindFileRequest) ProtoMessage() {} +func (*QueryFindFileRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{16} +} +func (m *QueryFindFileRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFindFileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFindFileRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFindFileRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFindFileRequest.Merge(m, src) +} +func (m *QueryFindFileRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryFindFileRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFindFileRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFindFileRequest proto.InternalMessageInfo + +func (m *QueryFindFileRequest) GetFid() string { + if m != nil { + return m.Fid + } + return "" +} + +type QueryFindFileResponse struct { + ProviderIps string `protobuf:"bytes,1,opt,name=providerIps,proto3" json:"providerIps,omitempty"` +} + +func (m *QueryFindFileResponse) Reset() { *m = QueryFindFileResponse{} } +func (m *QueryFindFileResponse) String() string { return proto.CompactTextString(m) } +func (*QueryFindFileResponse) ProtoMessage() {} +func (*QueryFindFileResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{17} +} +func (m *QueryFindFileResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFindFileResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFindFileResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFindFileResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFindFileResponse.Merge(m, src) +} +func (m *QueryFindFileResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryFindFileResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFindFileResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFindFileResponse proto.InternalMessageInfo + +func (m *QueryFindFileResponse) GetProviderIps() string { + if m != nil { + return m.ProviderIps + } + return "" +} + +type QueryGetPayBlocksRequest struct { + Blockid string `protobuf:"bytes,1,opt,name=blockid,proto3" json:"blockid,omitempty"` +} + +func (m *QueryGetPayBlocksRequest) Reset() { *m = QueryGetPayBlocksRequest{} } +func (m *QueryGetPayBlocksRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetPayBlocksRequest) ProtoMessage() {} +func (*QueryGetPayBlocksRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{18} +} +func (m *QueryGetPayBlocksRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetPayBlocksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetPayBlocksRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetPayBlocksRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetPayBlocksRequest.Merge(m, src) +} +func (m *QueryGetPayBlocksRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetPayBlocksRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetPayBlocksRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetPayBlocksRequest proto.InternalMessageInfo + +func (m *QueryGetPayBlocksRequest) GetBlockid() string { + if m != nil { + return m.Blockid + } + return "" +} + +type QueryGetPayBlocksResponse struct { + PayBlocks PayBlocks `protobuf:"bytes,1,opt,name=payBlocks,proto3" json:"payBlocks"` +} + +func (m *QueryGetPayBlocksResponse) Reset() { *m = QueryGetPayBlocksResponse{} } +func (m *QueryGetPayBlocksResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetPayBlocksResponse) ProtoMessage() {} +func (*QueryGetPayBlocksResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{19} +} +func (m *QueryGetPayBlocksResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetPayBlocksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetPayBlocksResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetPayBlocksResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetPayBlocksResponse.Merge(m, src) +} +func (m *QueryGetPayBlocksResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetPayBlocksResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetPayBlocksResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetPayBlocksResponse proto.InternalMessageInfo + +func (m *QueryGetPayBlocksResponse) GetPayBlocks() PayBlocks { + if m != nil { + return m.PayBlocks + } + return PayBlocks{} +} + +type QueryAllPayBlocksRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllPayBlocksRequest) Reset() { *m = QueryAllPayBlocksRequest{} } +func (m *QueryAllPayBlocksRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllPayBlocksRequest) ProtoMessage() {} +func (*QueryAllPayBlocksRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{20} +} +func (m *QueryAllPayBlocksRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllPayBlocksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllPayBlocksRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllPayBlocksRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllPayBlocksRequest.Merge(m, src) +} +func (m *QueryAllPayBlocksRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllPayBlocksRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllPayBlocksRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllPayBlocksRequest proto.InternalMessageInfo + +func (m *QueryAllPayBlocksRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllPayBlocksResponse struct { + PayBlocks []PayBlocks `protobuf:"bytes,1,rep,name=payBlocks,proto3" json:"payBlocks"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllPayBlocksResponse) Reset() { *m = QueryAllPayBlocksResponse{} } +func (m *QueryAllPayBlocksResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllPayBlocksResponse) ProtoMessage() {} +func (*QueryAllPayBlocksResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{21} +} +func (m *QueryAllPayBlocksResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllPayBlocksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllPayBlocksResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllPayBlocksResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllPayBlocksResponse.Merge(m, src) +} +func (m *QueryAllPayBlocksResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllPayBlocksResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllPayBlocksResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllPayBlocksResponse proto.InternalMessageInfo + +func (m *QueryAllPayBlocksResponse) GetPayBlocks() []PayBlocks { + if m != nil { + return m.PayBlocks + } + return nil +} + +func (m *QueryAllPayBlocksResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetClientUsageRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryGetClientUsageRequest) Reset() { *m = QueryGetClientUsageRequest{} } +func (m *QueryGetClientUsageRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetClientUsageRequest) ProtoMessage() {} +func (*QueryGetClientUsageRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{22} +} +func (m *QueryGetClientUsageRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetClientUsageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetClientUsageRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetClientUsageRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetClientUsageRequest.Merge(m, src) +} +func (m *QueryGetClientUsageRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetClientUsageRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetClientUsageRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetClientUsageRequest proto.InternalMessageInfo + +func (m *QueryGetClientUsageRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type QueryGetClientUsageResponse struct { + ClientUsage ClientUsage `protobuf:"bytes,1,opt,name=clientUsage,proto3" json:"clientUsage"` +} + +func (m *QueryGetClientUsageResponse) Reset() { *m = QueryGetClientUsageResponse{} } +func (m *QueryGetClientUsageResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetClientUsageResponse) ProtoMessage() {} +func (*QueryGetClientUsageResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{23} +} +func (m *QueryGetClientUsageResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetClientUsageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetClientUsageResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetClientUsageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetClientUsageResponse.Merge(m, src) +} +func (m *QueryGetClientUsageResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetClientUsageResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetClientUsageResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetClientUsageResponse proto.InternalMessageInfo + +func (m *QueryGetClientUsageResponse) GetClientUsage() ClientUsage { + if m != nil { + return m.ClientUsage + } + return ClientUsage{} +} + +type QueryAllClientUsageRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllClientUsageRequest) Reset() { *m = QueryAllClientUsageRequest{} } +func (m *QueryAllClientUsageRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllClientUsageRequest) ProtoMessage() {} +func (*QueryAllClientUsageRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{24} +} +func (m *QueryAllClientUsageRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllClientUsageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllClientUsageRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllClientUsageRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllClientUsageRequest.Merge(m, src) +} +func (m *QueryAllClientUsageRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllClientUsageRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllClientUsageRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllClientUsageRequest proto.InternalMessageInfo + +func (m *QueryAllClientUsageRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllClientUsageResponse struct { + ClientUsage []ClientUsage `protobuf:"bytes,1,rep,name=clientUsage,proto3" json:"clientUsage"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllClientUsageResponse) Reset() { *m = QueryAllClientUsageResponse{} } +func (m *QueryAllClientUsageResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllClientUsageResponse) ProtoMessage() {} +func (*QueryAllClientUsageResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{25} +} +func (m *QueryAllClientUsageResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllClientUsageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllClientUsageResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllClientUsageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllClientUsageResponse.Merge(m, src) +} +func (m *QueryAllClientUsageResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllClientUsageResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllClientUsageResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllClientUsageResponse proto.InternalMessageInfo + +func (m *QueryAllClientUsageResponse) GetClientUsage() []ClientUsage { + if m != nil { + return m.ClientUsage + } + return nil +} + +func (m *QueryAllClientUsageResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetStraysRequest struct { + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` +} + +func (m *QueryGetStraysRequest) Reset() { *m = QueryGetStraysRequest{} } +func (m *QueryGetStraysRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetStraysRequest) ProtoMessage() {} +func (*QueryGetStraysRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{26} +} +func (m *QueryGetStraysRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetStraysRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetStraysRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetStraysRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetStraysRequest.Merge(m, src) +} +func (m *QueryGetStraysRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetStraysRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetStraysRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetStraysRequest proto.InternalMessageInfo + +func (m *QueryGetStraysRequest) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +type QueryGetStraysResponse struct { + Strays Strays `protobuf:"bytes,1,opt,name=strays,proto3" json:"strays"` +} + +func (m *QueryGetStraysResponse) Reset() { *m = QueryGetStraysResponse{} } +func (m *QueryGetStraysResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetStraysResponse) ProtoMessage() {} +func (*QueryGetStraysResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{27} +} +func (m *QueryGetStraysResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetStraysResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetStraysResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetStraysResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetStraysResponse.Merge(m, src) +} +func (m *QueryGetStraysResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetStraysResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetStraysResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetStraysResponse proto.InternalMessageInfo + +func (m *QueryGetStraysResponse) GetStrays() Strays { + if m != nil { + return m.Strays + } + return Strays{} +} + +type QueryAllStraysRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllStraysRequest) Reset() { *m = QueryAllStraysRequest{} } +func (m *QueryAllStraysRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllStraysRequest) ProtoMessage() {} +func (*QueryAllStraysRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{28} +} +func (m *QueryAllStraysRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllStraysRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllStraysRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllStraysRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllStraysRequest.Merge(m, src) +} +func (m *QueryAllStraysRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllStraysRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllStraysRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllStraysRequest proto.InternalMessageInfo + +func (m *QueryAllStraysRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllStraysResponse struct { + Strays []Strays `protobuf:"bytes,1,rep,name=strays,proto3" json:"strays"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllStraysResponse) Reset() { *m = QueryAllStraysResponse{} } +func (m *QueryAllStraysResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllStraysResponse) ProtoMessage() {} +func (*QueryAllStraysResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{29} +} +func (m *QueryAllStraysResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllStraysResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllStraysResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllStraysResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllStraysResponse.Merge(m, src) +} +func (m *QueryAllStraysResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllStraysResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllStraysResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllStraysResponse proto.InternalMessageInfo + +func (m *QueryAllStraysResponse) GetStrays() []Strays { + if m != nil { + return m.Strays + } + return nil +} + +func (m *QueryAllStraysResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetClientFreeSpaceRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryGetClientFreeSpaceRequest) Reset() { *m = QueryGetClientFreeSpaceRequest{} } +func (m *QueryGetClientFreeSpaceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetClientFreeSpaceRequest) ProtoMessage() {} +func (*QueryGetClientFreeSpaceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{30} +} +func (m *QueryGetClientFreeSpaceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetClientFreeSpaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetClientFreeSpaceRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetClientFreeSpaceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetClientFreeSpaceRequest.Merge(m, src) +} +func (m *QueryGetClientFreeSpaceRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetClientFreeSpaceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetClientFreeSpaceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetClientFreeSpaceRequest proto.InternalMessageInfo + +func (m *QueryGetClientFreeSpaceRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type QueryGetClientFreeSpaceResponse struct { + Bytesfree string `protobuf:"bytes,1,opt,name=bytesfree,proto3" json:"bytesfree,omitempty"` +} + +func (m *QueryGetClientFreeSpaceResponse) Reset() { *m = QueryGetClientFreeSpaceResponse{} } +func (m *QueryGetClientFreeSpaceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetClientFreeSpaceResponse) ProtoMessage() {} +func (*QueryGetClientFreeSpaceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{31} +} +func (m *QueryGetClientFreeSpaceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetClientFreeSpaceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetClientFreeSpaceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetClientFreeSpaceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetClientFreeSpaceResponse.Merge(m, src) +} +func (m *QueryGetClientFreeSpaceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetClientFreeSpaceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetClientFreeSpaceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetClientFreeSpaceResponse proto.InternalMessageInfo + +func (m *QueryGetClientFreeSpaceResponse) GetBytesfree() string { + if m != nil { + return m.Bytesfree + } + return "" +} + +type QueryGetFidCidRequest struct { + Fid string `protobuf:"bytes,1,opt,name=fid,proto3" json:"fid,omitempty"` +} + +func (m *QueryGetFidCidRequest) Reset() { *m = QueryGetFidCidRequest{} } +func (m *QueryGetFidCidRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetFidCidRequest) ProtoMessage() {} +func (*QueryGetFidCidRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{32} +} +func (m *QueryGetFidCidRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetFidCidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetFidCidRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetFidCidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetFidCidRequest.Merge(m, src) +} +func (m *QueryGetFidCidRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetFidCidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetFidCidRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetFidCidRequest proto.InternalMessageInfo + +func (m *QueryGetFidCidRequest) GetFid() string { + if m != nil { + return m.Fid + } + return "" +} + +type QueryGetFidCidResponse struct { + FidCid FidCid `protobuf:"bytes,1,opt,name=fidCid,proto3" json:"fidCid"` +} + +func (m *QueryGetFidCidResponse) Reset() { *m = QueryGetFidCidResponse{} } +func (m *QueryGetFidCidResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetFidCidResponse) ProtoMessage() {} +func (*QueryGetFidCidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{33} +} +func (m *QueryGetFidCidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetFidCidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetFidCidResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetFidCidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetFidCidResponse.Merge(m, src) +} +func (m *QueryGetFidCidResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetFidCidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetFidCidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetFidCidResponse proto.InternalMessageInfo + +func (m *QueryGetFidCidResponse) GetFidCid() FidCid { + if m != nil { + return m.FidCid + } + return FidCid{} +} + +type QueryAllFidCidRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllFidCidRequest) Reset() { *m = QueryAllFidCidRequest{} } +func (m *QueryAllFidCidRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllFidCidRequest) ProtoMessage() {} +func (*QueryAllFidCidRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{34} +} +func (m *QueryAllFidCidRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllFidCidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllFidCidRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllFidCidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllFidCidRequest.Merge(m, src) +} +func (m *QueryAllFidCidRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllFidCidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllFidCidRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllFidCidRequest proto.InternalMessageInfo + +func (m *QueryAllFidCidRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllFidCidResponse struct { + FidCid []FidCid `protobuf:"bytes,1,rep,name=fidCid,proto3" json:"fidCid"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllFidCidResponse) Reset() { *m = QueryAllFidCidResponse{} } +func (m *QueryAllFidCidResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllFidCidResponse) ProtoMessage() {} +func (*QueryAllFidCidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{35} +} +func (m *QueryAllFidCidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllFidCidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllFidCidResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllFidCidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllFidCidResponse.Merge(m, src) +} +func (m *QueryAllFidCidResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllFidCidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllFidCidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllFidCidResponse proto.InternalMessageInfo + +func (m *QueryAllFidCidResponse) GetFidCid() []FidCid { + if m != nil { + return m.FidCid + } + return nil +} + +func (m *QueryAllFidCidResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetPayDataRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryGetPayDataRequest) Reset() { *m = QueryGetPayDataRequest{} } +func (m *QueryGetPayDataRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetPayDataRequest) ProtoMessage() {} +func (*QueryGetPayDataRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{36} +} +func (m *QueryGetPayDataRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetPayDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetPayDataRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetPayDataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetPayDataRequest.Merge(m, src) +} +func (m *QueryGetPayDataRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetPayDataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetPayDataRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetPayDataRequest proto.InternalMessageInfo + +func (m *QueryGetPayDataRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type QueryGetPayDataResponse struct { + BlocksRemaining int64 `protobuf:"varint,1,opt,name=blocks_remaining,json=blocksRemaining,proto3" json:"blocks_remaining,omitempty"` + Bytes int64 `protobuf:"varint,2,opt,name=bytes,proto3" json:"bytes,omitempty"` +} + +func (m *QueryGetPayDataResponse) Reset() { *m = QueryGetPayDataResponse{} } +func (m *QueryGetPayDataResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetPayDataResponse) ProtoMessage() {} +func (*QueryGetPayDataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5e79a7b82ee692e, []int{37} +} +func (m *QueryGetPayDataResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetPayDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetPayDataResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetPayDataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetPayDataResponse.Merge(m, src) +} +func (m *QueryGetPayDataResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetPayDataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetPayDataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetPayDataResponse proto.InternalMessageInfo + +func (m *QueryGetPayDataResponse) GetBlocksRemaining() int64 { + if m != nil { + return m.BlocksRemaining + } + return 0 +} + +func (m *QueryGetPayDataResponse) GetBytes() int64 { + if m != nil { + return m.Bytes + } + return 0 +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "jackaldao.canine.storage.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "jackaldao.canine.storage.QueryParamsResponse") + proto.RegisterType((*QueryGetContractsRequest)(nil), "jackaldao.canine.storage.QueryGetContractsRequest") + proto.RegisterType((*QueryGetContractsResponse)(nil), "jackaldao.canine.storage.QueryGetContractsResponse") + proto.RegisterType((*QueryAllContractsRequest)(nil), "jackaldao.canine.storage.QueryAllContractsRequest") + proto.RegisterType((*QueryAllContractsResponse)(nil), "jackaldao.canine.storage.QueryAllContractsResponse") + proto.RegisterType((*QueryGetActiveDealsRequest)(nil), "jackaldao.canine.storage.QueryGetActiveDealsRequest") + proto.RegisterType((*QueryGetActiveDealsResponse)(nil), "jackaldao.canine.storage.QueryGetActiveDealsResponse") + proto.RegisterType((*QueryAllActiveDealsRequest)(nil), "jackaldao.canine.storage.QueryAllActiveDealsRequest") + proto.RegisterType((*QueryAllActiveDealsResponse)(nil), "jackaldao.canine.storage.QueryAllActiveDealsResponse") + proto.RegisterType((*QueryGetProvidersRequest)(nil), "jackaldao.canine.storage.QueryGetProvidersRequest") + proto.RegisterType((*QueryGetProvidersResponse)(nil), "jackaldao.canine.storage.QueryGetProvidersResponse") + proto.RegisterType((*QueryAllProvidersRequest)(nil), "jackaldao.canine.storage.QueryAllProvidersRequest") + proto.RegisterType((*QueryAllProvidersResponse)(nil), "jackaldao.canine.storage.QueryAllProvidersResponse") + proto.RegisterType((*QueryFreespaceRequest)(nil), "jackaldao.canine.storage.QueryFreespaceRequest") + proto.RegisterType((*QueryFreespaceResponse)(nil), "jackaldao.canine.storage.QueryFreespaceResponse") + proto.RegisterType((*QueryFindFileRequest)(nil), "jackaldao.canine.storage.QueryFindFileRequest") + proto.RegisterType((*QueryFindFileResponse)(nil), "jackaldao.canine.storage.QueryFindFileResponse") + proto.RegisterType((*QueryGetPayBlocksRequest)(nil), "jackaldao.canine.storage.QueryGetPayBlocksRequest") + proto.RegisterType((*QueryGetPayBlocksResponse)(nil), "jackaldao.canine.storage.QueryGetPayBlocksResponse") + proto.RegisterType((*QueryAllPayBlocksRequest)(nil), "jackaldao.canine.storage.QueryAllPayBlocksRequest") + proto.RegisterType((*QueryAllPayBlocksResponse)(nil), "jackaldao.canine.storage.QueryAllPayBlocksResponse") + proto.RegisterType((*QueryGetClientUsageRequest)(nil), "jackaldao.canine.storage.QueryGetClientUsageRequest") + proto.RegisterType((*QueryGetClientUsageResponse)(nil), "jackaldao.canine.storage.QueryGetClientUsageResponse") + proto.RegisterType((*QueryAllClientUsageRequest)(nil), "jackaldao.canine.storage.QueryAllClientUsageRequest") + proto.RegisterType((*QueryAllClientUsageResponse)(nil), "jackaldao.canine.storage.QueryAllClientUsageResponse") + proto.RegisterType((*QueryGetStraysRequest)(nil), "jackaldao.canine.storage.QueryGetStraysRequest") + proto.RegisterType((*QueryGetStraysResponse)(nil), "jackaldao.canine.storage.QueryGetStraysResponse") + proto.RegisterType((*QueryAllStraysRequest)(nil), "jackaldao.canine.storage.QueryAllStraysRequest") + proto.RegisterType((*QueryAllStraysResponse)(nil), "jackaldao.canine.storage.QueryAllStraysResponse") + proto.RegisterType((*QueryGetClientFreeSpaceRequest)(nil), "jackaldao.canine.storage.QueryGetClientFreeSpaceRequest") + proto.RegisterType((*QueryGetClientFreeSpaceResponse)(nil), "jackaldao.canine.storage.QueryGetClientFreeSpaceResponse") + proto.RegisterType((*QueryGetFidCidRequest)(nil), "jackaldao.canine.storage.QueryGetFidCidRequest") + proto.RegisterType((*QueryGetFidCidResponse)(nil), "jackaldao.canine.storage.QueryGetFidCidResponse") + proto.RegisterType((*QueryAllFidCidRequest)(nil), "jackaldao.canine.storage.QueryAllFidCidRequest") + proto.RegisterType((*QueryAllFidCidResponse)(nil), "jackaldao.canine.storage.QueryAllFidCidResponse") + proto.RegisterType((*QueryGetPayDataRequest)(nil), "jackaldao.canine.storage.QueryGetPayDataRequest") + proto.RegisterType((*QueryGetPayDataResponse)(nil), "jackaldao.canine.storage.QueryGetPayDataResponse") +} + +func init() { proto.RegisterFile("canine-chain/storage/query.proto", fileDescriptor_b5e79a7b82ee692e) } + +var fileDescriptor_b5e79a7b82ee692e = []byte{ + // 1479 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0x4f, 0x6f, 0xdc, 0x44, + 0x14, 0x8f, 0xbb, 0x34, 0xb0, 0x93, 0x0a, 0xaa, 0x21, 0x40, 0xba, 0x54, 0xdb, 0xd4, 0x6d, 0x9a, + 0x3f, 0x4a, 0xec, 0x6c, 0x92, 0x16, 0x52, 0x21, 0x50, 0x92, 0x2a, 0x11, 0x07, 0xa4, 0xb0, 0x55, + 0x25, 0xd4, 0xcb, 0x6a, 0xd6, 0x9e, 0xdd, 0x9a, 0x3a, 0xf6, 0xd6, 0x76, 0x22, 0x56, 0x51, 0x2f, + 0x7c, 0x82, 0x4a, 0x9c, 0x40, 0x20, 0xc4, 0x01, 0xc4, 0x81, 0x20, 0x71, 0xe8, 0x77, 0xe8, 0x05, + 0xa9, 0x12, 0x17, 0x4e, 0x08, 0x25, 0x7c, 0x10, 0xe4, 0xf9, 0x63, 0x8f, 0xd7, 0x5e, 0x7b, 0xbc, + 0xdd, 0xdc, 0xb2, 0x93, 0xf7, 0xde, 0xfc, 0xde, 0x7b, 0xbf, 0x79, 0x33, 0xbf, 0x5d, 0x30, 0x6b, + 0x20, 0xc7, 0x72, 0xf0, 0x8a, 0xf1, 0x08, 0x59, 0x8e, 0xee, 0x07, 0xae, 0x87, 0xba, 0x58, 0x7f, + 0x72, 0x88, 0xbd, 0xbe, 0xd6, 0xf3, 0xdc, 0xc0, 0x85, 0x33, 0x5f, 0x22, 0xe3, 0x31, 0xb2, 0x4d, + 0xe4, 0x6a, 0xd4, 0x56, 0x63, 0x56, 0xb5, 0xe9, 0xae, 0xdb, 0x75, 0x89, 0x91, 0x1e, 0xfe, 0x45, + 0xed, 0x6b, 0x57, 0xbb, 0xae, 0xdb, 0xb5, 0xb1, 0x8e, 0x7a, 0x96, 0x8e, 0x1c, 0xc7, 0x0d, 0x50, + 0x60, 0xb9, 0x8e, 0xcf, 0xfe, 0xbb, 0x64, 0xb8, 0xfe, 0x81, 0xeb, 0xeb, 0x6d, 0xe4, 0xb3, 0x6d, + 0xf4, 0xa3, 0x46, 0x1b, 0x07, 0xa8, 0xa1, 0xf7, 0x50, 0xd7, 0x72, 0x88, 0x31, 0xb3, 0xbd, 0x9e, + 0x89, 0xad, 0x87, 0x3c, 0x74, 0xc0, 0xc3, 0xdd, 0xcc, 0x34, 0x31, 0x5c, 0x27, 0xf0, 0x90, 0x11, + 0x70, 0xab, 0xf9, 0x4c, 0x2b, 0x64, 0x04, 0xd6, 0x11, 0x6e, 0x99, 0x18, 0xd9, 0xf9, 0xe1, 0x7a, + 0x9e, 0x7b, 0x64, 0x99, 0xd8, 0xe3, 0x56, 0x73, 0x43, 0x70, 0xf5, 0x5b, 0x6d, 0xdb, 0x35, 0x1e, + 0xe7, 0xef, 0x6a, 0xd8, 0x16, 0x76, 0x82, 0xd6, 0xa1, 0x8f, 0xba, 0x38, 0x37, 0x4f, 0x3f, 0xf0, + 0x50, 0x9f, 0xc7, 0x52, 0x33, 0x4d, 0x3a, 0x96, 0xd9, 0x32, 0x2c, 0x93, 0xda, 0xa8, 0xd3, 0x00, + 0x7e, 0x1e, 0x16, 0x74, 0x9f, 0x14, 0xa8, 0x89, 0x9f, 0x1c, 0x62, 0x3f, 0x50, 0x1f, 0x80, 0xb7, + 0x13, 0xab, 0x7e, 0xcf, 0x75, 0x7c, 0x0c, 0x3f, 0x06, 0x93, 0xb4, 0x90, 0x33, 0xca, 0xac, 0xb2, + 0x30, 0xb5, 0x36, 0xab, 0x0d, 0x6b, 0xb3, 0x46, 0x3d, 0xb7, 0x5f, 0x7b, 0xf1, 0xcf, 0xb5, 0x89, + 0x26, 0xf3, 0x52, 0x97, 0xc1, 0x0c, 0x09, 0xbb, 0x87, 0x83, 0x1d, 0x5e, 0x6d, 0xb6, 0x25, 0xbc, + 0x0c, 0x2a, 0x86, 0x65, 0x92, 0xc0, 0xd5, 0x66, 0xf8, 0xa7, 0x6a, 0x82, 0x2b, 0x19, 0xd6, 0x0c, + 0xca, 0x1e, 0xa8, 0x46, 0x0d, 0x63, 0x68, 0x6e, 0x0c, 0x47, 0x13, 0xf9, 0x33, 0x40, 0xb1, 0xaf, + 0xda, 0x66, 0x98, 0xb6, 0x6c, 0x3b, 0x85, 0x69, 0x17, 0x80, 0x98, 0x5f, 0x6c, 0x97, 0x5b, 0x1a, + 0x25, 0xa3, 0x16, 0x92, 0x51, 0xa3, 0x9c, 0x67, 0x64, 0xd4, 0xf6, 0x51, 0x17, 0x33, 0xdf, 0xa6, + 0xe0, 0xa9, 0x9e, 0x28, 0x2c, 0x95, 0xe4, 0x26, 0xd9, 0xa9, 0x54, 0x46, 0x4d, 0x05, 0xee, 0x25, + 0xe0, 0x5e, 0x20, 0x70, 0xe7, 0x0b, 0xe1, 0x52, 0x14, 0x09, 0xbc, 0x1a, 0xa8, 0xf1, 0xca, 0x6f, + 0x11, 0xbe, 0xdf, 0x0b, 0xe9, 0x3e, 0xbc, 0x53, 0x36, 0x78, 0x3f, 0xd3, 0x9e, 0x25, 0xf8, 0x19, + 0x98, 0x42, 0xf1, 0x32, 0xab, 0xe3, 0xdc, 0xf0, 0x14, 0x85, 0x18, 0x2c, 0x49, 0xd1, 0x5f, 0x35, + 0x19, 0xba, 0x2d, 0xdb, 0xce, 0x40, 0x37, 0xae, 0x9e, 0x3d, 0x57, 0x58, 0x52, 0x83, 0xdb, 0x0c, + 0x4b, 0xaa, 0xf2, 0x2a, 0x49, 0x8d, 0xaf, 0x77, 0x1b, 0xf1, 0x19, 0xdb, 0xe7, 0x23, 0x88, 0xd7, + 0x66, 0x06, 0xbc, 0x8e, 0x4c, 0xd3, 0xc3, 0xbe, 0xcf, 0xba, 0xc7, 0x3f, 0x8a, 0x67, 0x4d, 0xf0, + 0x8a, 0x09, 0x1a, 0x4d, 0xb3, 0xe2, 0xb3, 0x16, 0xf9, 0x73, 0x82, 0x46, 0xbe, 0xe2, 0x59, 0x4b, + 0x61, 0x3b, 0x8f, 0xb3, 0x56, 0x98, 0x4a, 0x65, 0xd4, 0x54, 0xc6, 0xd7, 0xaf, 0x06, 0x78, 0x87, + 0xc0, 0xdd, 0xf5, 0x30, 0xf6, 0x7b, 0xc8, 0xc0, 0xc5, 0xcd, 0xd2, 0xc0, 0xbb, 0x83, 0x2e, 0x2c, + 0xbd, 0x69, 0x70, 0x91, 0x2c, 0x30, 0x0f, 0xfa, 0x41, 0x5d, 0x00, 0xd3, 0xd4, 0xde, 0x72, 0xcc, + 0x5d, 0xcb, 0xc6, 0xc2, 0x41, 0xee, 0xc4, 0x07, 0xb9, 0x63, 0x99, 0xea, 0x26, 0x07, 0x13, 0x59, + 0xb2, 0xc0, 0xb3, 0x60, 0x8a, 0xe7, 0xfe, 0x69, 0x8f, 0x03, 0x12, 0x97, 0x12, 0xbc, 0x43, 0xfd, + 0x6d, 0x72, 0xa7, 0x09, 0xa9, 0x90, 0x4b, 0x2e, 0xda, 0x8c, 0x7f, 0x4c, 0xf0, 0x2e, 0xf6, 0x12, + 0x9a, 0xc5, 0x17, 0x25, 0x78, 0xc7, 0x4d, 0xa3, 0x66, 0xf1, 0x85, 0x04, 0xef, 0x06, 0xb1, 0x9d, + 0x0b, 0xef, 0x8a, 0x52, 0xa9, 0x8c, 0x9a, 0xca, 0xf8, 0x78, 0x77, 0x27, 0x9e, 0xf1, 0x3b, 0xe4, + 0x75, 0xf1, 0xc0, 0x8f, 0x33, 0xcb, 0x21, 0x9f, 0x30, 0xeb, 0x13, 0x7e, 0xf1, 0x58, 0x34, 0xe2, + 0xe5, 0xe2, 0x59, 0x2f, 0xc4, 0xe0, 0x63, 0x51, 0xf0, 0x17, 0x67, 0x7d, 0x06, 0xca, 0xf3, 0x98, + 0xf5, 0x52, 0x49, 0x55, 0x5e, 0x25, 0xa9, 0xf1, 0xf5, 0x70, 0x91, 0x1d, 0xd7, 0x3d, 0x1c, 0xdc, + 0x27, 0x0f, 0xbf, 0xe1, 0x57, 0xf4, 0x17, 0x6c, 0x66, 0x08, 0xa6, 0xf1, 0xa3, 0x8e, 0xbe, 0x1a, + 0x8b, 0x1f, 0x75, 0xd4, 0x93, 0x3f, 0xea, 0xa8, 0x97, 0xda, 0x62, 0x20, 0xb6, 0x6c, 0x3b, 0x09, + 0x62, 0x5c, 0xdd, 0xf9, 0x49, 0x61, 0xd8, 0x85, 0x1d, 0x32, 0xb0, 0x57, 0xca, 0x63, 0x1f, 0x5f, + 0x27, 0xee, 0x82, 0x7a, 0xf2, 0x54, 0x84, 0xb3, 0xf9, 0xbe, 0xdc, 0x38, 0xff, 0x04, 0x5c, 0x1b, + 0xea, 0xcb, 0xf2, 0xbc, 0x0a, 0xaa, 0xed, 0x7e, 0x80, 0xfd, 0x8e, 0x87, 0xf9, 0x6c, 0x8f, 0x17, + 0x44, 0x1a, 0xec, 0x5a, 0xe6, 0x8e, 0x65, 0x0e, 0x1f, 0xf0, 0x02, 0x0d, 0xb8, 0x69, 0x5c, 0xca, + 0x0e, 0x59, 0x29, 0xa6, 0x01, 0xf5, 0xe4, 0xa5, 0xa4, 0x5e, 0x22, 0x0d, 0x92, 0x20, 0xce, 0x83, + 0x06, 0x39, 0xd8, 0x2b, 0xe5, 0xb1, 0x8f, 0x8f, 0x06, 0x6b, 0x71, 0x79, 0xf7, 0x51, 0xff, 0x1e, + 0x0a, 0x50, 0x71, 0xfb, 0x1f, 0x82, 0xf7, 0x52, 0x3e, 0x2c, 0xaf, 0x45, 0x70, 0x99, 0x8a, 0xc3, + 0x96, 0x87, 0x0f, 0x90, 0xe5, 0x58, 0x4e, 0x97, 0x78, 0x57, 0x9a, 0x6f, 0xb5, 0xd9, 0xfd, 0xc2, + 0x96, 0xc3, 0x9b, 0x9f, 0x10, 0x82, 0xa0, 0xaf, 0x34, 0xe9, 0x87, 0xb5, 0x93, 0x2b, 0xe0, 0x22, + 0x09, 0x0e, 0x9f, 0x29, 0x60, 0x92, 0x6a, 0x32, 0xb8, 0x3c, 0xbc, 0x3a, 0x69, 0x29, 0x58, 0x5b, + 0x91, 0xb4, 0xa6, 0x90, 0xd5, 0xc5, 0xaf, 0xff, 0xfa, 0xef, 0x9b, 0x0b, 0x37, 0xe0, 0x75, 0x9d, + 0xba, 0xad, 0x98, 0xc8, 0xd5, 0xa9, 0xdf, 0x80, 0x18, 0x87, 0xbf, 0x2a, 0xa0, 0x1a, 0xa9, 0x19, + 0xb8, 0x56, 0xb0, 0x4f, 0x86, 0x66, 0xac, 0xad, 0x97, 0xf2, 0x61, 0x08, 0xd7, 0x08, 0xc2, 0x65, + 0xb8, 0x94, 0x83, 0x30, 0xd2, 0x54, 0xfa, 0xb1, 0x61, 0x99, 0x4f, 0xe1, 0xcf, 0x0a, 0xb8, 0x14, + 0x45, 0xda, 0xb2, 0xed, 0x42, 0xb4, 0x19, 0x6a, 0xb2, 0x10, 0x6d, 0x96, 0x38, 0x54, 0x97, 0x09, + 0xda, 0x5b, 0xf0, 0xa6, 0x0c, 0x5a, 0xf8, 0x87, 0x02, 0xa6, 0x04, 0xa1, 0x01, 0x37, 0x8a, 0x0b, + 0x94, 0x96, 0x50, 0xb5, 0xdb, 0x25, 0xbd, 0x18, 0xd4, 0xdb, 0x04, 0xaa, 0x0e, 0x57, 0x72, 0xa0, + 0x8a, 0x5f, 0x9f, 0xb0, 0xda, 0xfe, 0xae, 0x80, 0x37, 0x85, 0x70, 0x61, 0x75, 0x37, 0x8a, 0x2b, + 0x35, 0x02, 0xec, 0x6c, 0x21, 0xa7, 0xea, 0x04, 0xf6, 0x22, 0x9c, 0x97, 0x84, 0x0d, 0x7f, 0x53, + 0x40, 0x35, 0x52, 0x06, 0x32, 0xbc, 0x1d, 0xd4, 0x3a, 0x32, 0xbc, 0x4d, 0x49, 0x17, 0xf5, 0x0e, + 0xc1, 0xb9, 0x0a, 0xb5, 0xbc, 0x93, 0xc5, 0xbd, 0xf4, 0x63, 0x36, 0x5e, 0x28, 0x77, 0xa3, 0x68, + 0x92, 0xdc, 0x2d, 0x8d, 0x38, 0x4b, 0x6c, 0x49, 0x71, 0x37, 0x56, 0x54, 0xbf, 0x28, 0xa0, 0x1a, + 0x29, 0x1a, 0xa8, 0x17, 0x6c, 0x38, 0x28, 0x97, 0x6a, 0xab, 0xf2, 0x0e, 0x25, 0x0a, 0xda, 0xe1, + 0x5e, 0x42, 0x41, 0x7f, 0x54, 0xc0, 0x1b, 0x5c, 0x20, 0x41, 0xad, 0x68, 0xdb, 0xa4, 0xe6, 0xaa, + 0xe9, 0xd2, 0xf6, 0x25, 0xc6, 0x55, 0xc7, 0x72, 0xcc, 0x56, 0xc7, 0xb2, 0xb1, 0x7e, 0xdc, 0x09, + 0x8f, 0xd4, 0x49, 0xc8, 0xd0, 0x48, 0x32, 0xc8, 0x30, 0x74, 0x40, 0x15, 0x49, 0x31, 0x74, 0x50, + 0xe4, 0xa8, 0x1f, 0x10, 0xa8, 0x0d, 0xa8, 0xe7, 0xce, 0x7e, 0xfe, 0x85, 0xa7, 0x7e, 0xcc, 0x44, + 0xe0, 0xd3, 0xb0, 0xf5, 0x97, 0xa2, 0x70, 0xb2, 0x14, 0x2d, 0x0b, 0x39, 0x4b, 0x97, 0xa9, 0x2b, + 0x04, 0xf2, 0x3c, 0x9c, 0x93, 0x82, 0x0c, 0x9f, 0x2b, 0x60, 0x4a, 0x78, 0xdc, 0xcb, 0xcc, 0xd7, + 0xb4, 0x6c, 0x91, 0x99, 0xaf, 0x19, 0x2a, 0x44, 0xdd, 0x24, 0x58, 0xd7, 0x61, 0x23, 0xef, 0x2a, + 0x10, 0xbe, 0x28, 0x16, 0x28, 0x1b, 0xce, 0x58, 0x21, 0xa4, 0xe4, 0x8c, 0x1d, 0x01, 0x7a, 0xb6, + 0x80, 0x92, 0x9a, 0xb1, 0x22, 0x74, 0xf8, 0xbd, 0x02, 0x26, 0xe9, 0x8b, 0xbd, 0x70, 0x12, 0x0c, + 0x8a, 0x9f, 0xc2, 0x49, 0x90, 0x92, 0x40, 0x52, 0xf0, 0xa8, 0x62, 0x60, 0x77, 0xd6, 0xb7, 0x0a, + 0xa8, 0xd2, 0x18, 0x61, 0x29, 0xf5, 0xe2, 0xa2, 0x94, 0x43, 0x98, 0x12, 0x3a, 0x52, 0xcf, 0x2a, + 0xa6, 0x69, 0xfe, 0x54, 0x00, 0x4c, 0x4b, 0x09, 0xf8, 0xa1, 0x2c, 0xe9, 0x06, 0x95, 0x4b, 0x6d, + 0x73, 0x04, 0x4f, 0x06, 0x7b, 0x9b, 0xc0, 0xfe, 0x08, 0xde, 0xcd, 0x81, 0xdd, 0xc5, 0x41, 0x8b, + 0xf5, 0x3e, 0x9c, 0xb6, 0xad, 0xc1, 0x71, 0xfb, 0x83, 0x02, 0x26, 0xe9, 0xab, 0x5d, 0x86, 0x0a, + 0x09, 0xed, 0x21, 0x43, 0x85, 0xa4, 0x94, 0x50, 0x57, 0x09, 0xe2, 0x25, 0xb8, 0x90, 0x3b, 0x6e, + 0xc9, 0x2f, 0x28, 0x6c, 0xd8, 0x7e, 0x17, 0xde, 0x5b, 0x24, 0x88, 0x24, 0x17, 0xca, 0x41, 0x4c, + 0xa9, 0x1d, 0x75, 0x89, 0x40, 0xbc, 0x09, 0xd5, 0x62, 0x88, 0xe1, 0x5b, 0x05, 0xc4, 0xc2, 0x02, + 0xae, 0x4a, 0x8d, 0x75, 0x41, 0xb7, 0xd4, 0x1a, 0x25, 0x3c, 0x4a, 0xcc, 0xa9, 0xb0, 0xe9, 0xe1, + 0x5c, 0x35, 0x51, 0x80, 0xe2, 0x5e, 0x6f, 0xef, 0xbe, 0x38, 0xad, 0x2b, 0x2f, 0x4f, 0xeb, 0xca, + 0xbf, 0xa7, 0x75, 0xe5, 0xd9, 0x59, 0x7d, 0xe2, 0xe5, 0x59, 0x7d, 0xe2, 0xef, 0xb3, 0xfa, 0xc4, + 0xc3, 0xe5, 0xae, 0x15, 0x3c, 0x3a, 0x6c, 0x6b, 0x86, 0x7b, 0x90, 0x11, 0xf6, 0xab, 0x28, 0x70, + 0xd0, 0xef, 0x61, 0xbf, 0x3d, 0x49, 0x7e, 0xdc, 0x5a, 0xff, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x56, + 0x4c, 0x9b, 0x55, 0xa9, 0x1c, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries a Contracts by index. + Contracts(ctx context.Context, in *QueryGetContractsRequest, opts ...grpc.CallOption) (*QueryGetContractsResponse, error) + // Queries a list of Contracts items. + ContractsAll(ctx context.Context, in *QueryAllContractsRequest, opts ...grpc.CallOption) (*QueryAllContractsResponse, error) + // Queries a ActiveDeals by index. + ActiveDeals(ctx context.Context, in *QueryGetActiveDealsRequest, opts ...grpc.CallOption) (*QueryGetActiveDealsResponse, error) + // Queries a list of ActiveDeals items. + ActiveDealsAll(ctx context.Context, in *QueryAllActiveDealsRequest, opts ...grpc.CallOption) (*QueryAllActiveDealsResponse, error) + // Queries a Providers by index. + Providers(ctx context.Context, in *QueryGetProvidersRequest, opts ...grpc.CallOption) (*QueryGetProvidersResponse, error) + // Queries a list of Providers items. + ProvidersAll(ctx context.Context, in *QueryAllProvidersRequest, opts ...grpc.CallOption) (*QueryAllProvidersResponse, error) + // Queries a list of Freespace items. + Freespace(ctx context.Context, in *QueryFreespaceRequest, opts ...grpc.CallOption) (*QueryFreespaceResponse, error) + // Queries a list of FindFile items. + FindFile(ctx context.Context, in *QueryFindFileRequest, opts ...grpc.CallOption) (*QueryFindFileResponse, error) + // Queries a PayBlocks by index. + PayBlocks(ctx context.Context, in *QueryGetPayBlocksRequest, opts ...grpc.CallOption) (*QueryGetPayBlocksResponse, error) + // Queries a list of PayBlocks items. + PayBlocksAll(ctx context.Context, in *QueryAllPayBlocksRequest, opts ...grpc.CallOption) (*QueryAllPayBlocksResponse, error) + // Queries a ClientUsage by index. + ClientUsage(ctx context.Context, in *QueryGetClientUsageRequest, opts ...grpc.CallOption) (*QueryGetClientUsageResponse, error) + // Queries a list of ClientUsage items. + ClientUsageAll(ctx context.Context, in *QueryAllClientUsageRequest, opts ...grpc.CallOption) (*QueryAllClientUsageResponse, error) + // Queries a Strays by index. + Strays(ctx context.Context, in *QueryGetStraysRequest, opts ...grpc.CallOption) (*QueryGetStraysResponse, error) + // Queries a list of Strays items. + StraysAll(ctx context.Context, in *QueryAllStraysRequest, opts ...grpc.CallOption) (*QueryAllStraysResponse, error) + // Queries a list of GetClientFreeSpace items. + GetClientFreeSpace(ctx context.Context, in *QueryGetClientFreeSpaceRequest, opts ...grpc.CallOption) (*QueryGetClientFreeSpaceResponse, error) + // Queries a FidCid by index. + FidCid(ctx context.Context, in *QueryGetFidCidRequest, opts ...grpc.CallOption) (*QueryGetFidCidResponse, error) + // Queries a list of FidCid items. + FidCidAll(ctx context.Context, in *QueryAllFidCidRequest, opts ...grpc.CallOption) (*QueryAllFidCidResponse, error) + // Queries a list of GetPayData items. + GetPayData(ctx context.Context, in *QueryGetPayDataRequest, opts ...grpc.CallOption) (*QueryGetPayDataResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Contracts(ctx context.Context, in *QueryGetContractsRequest, opts ...grpc.CallOption) (*QueryGetContractsResponse, error) { + out := new(QueryGetContractsResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/Contracts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ContractsAll(ctx context.Context, in *QueryAllContractsRequest, opts ...grpc.CallOption) (*QueryAllContractsResponse, error) { + out := new(QueryAllContractsResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/ContractsAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ActiveDeals(ctx context.Context, in *QueryGetActiveDealsRequest, opts ...grpc.CallOption) (*QueryGetActiveDealsResponse, error) { + out := new(QueryGetActiveDealsResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/ActiveDeals", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ActiveDealsAll(ctx context.Context, in *QueryAllActiveDealsRequest, opts ...grpc.CallOption) (*QueryAllActiveDealsResponse, error) { + out := new(QueryAllActiveDealsResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/ActiveDealsAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Providers(ctx context.Context, in *QueryGetProvidersRequest, opts ...grpc.CallOption) (*QueryGetProvidersResponse, error) { + out := new(QueryGetProvidersResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/Providers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ProvidersAll(ctx context.Context, in *QueryAllProvidersRequest, opts ...grpc.CallOption) (*QueryAllProvidersResponse, error) { + out := new(QueryAllProvidersResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/ProvidersAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Freespace(ctx context.Context, in *QueryFreespaceRequest, opts ...grpc.CallOption) (*QueryFreespaceResponse, error) { + out := new(QueryFreespaceResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/Freespace", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) FindFile(ctx context.Context, in *QueryFindFileRequest, opts ...grpc.CallOption) (*QueryFindFileResponse, error) { + out := new(QueryFindFileResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/FindFile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) PayBlocks(ctx context.Context, in *QueryGetPayBlocksRequest, opts ...grpc.CallOption) (*QueryGetPayBlocksResponse, error) { + out := new(QueryGetPayBlocksResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/PayBlocks", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) PayBlocksAll(ctx context.Context, in *QueryAllPayBlocksRequest, opts ...grpc.CallOption) (*QueryAllPayBlocksResponse, error) { + out := new(QueryAllPayBlocksResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/PayBlocksAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ClientUsage(ctx context.Context, in *QueryGetClientUsageRequest, opts ...grpc.CallOption) (*QueryGetClientUsageResponse, error) { + out := new(QueryGetClientUsageResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/ClientUsage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ClientUsageAll(ctx context.Context, in *QueryAllClientUsageRequest, opts ...grpc.CallOption) (*QueryAllClientUsageResponse, error) { + out := new(QueryAllClientUsageResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/ClientUsageAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Strays(ctx context.Context, in *QueryGetStraysRequest, opts ...grpc.CallOption) (*QueryGetStraysResponse, error) { + out := new(QueryGetStraysResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/Strays", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) StraysAll(ctx context.Context, in *QueryAllStraysRequest, opts ...grpc.CallOption) (*QueryAllStraysResponse, error) { + out := new(QueryAllStraysResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/StraysAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetClientFreeSpace(ctx context.Context, in *QueryGetClientFreeSpaceRequest, opts ...grpc.CallOption) (*QueryGetClientFreeSpaceResponse, error) { + out := new(QueryGetClientFreeSpaceResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/GetClientFreeSpace", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) FidCid(ctx context.Context, in *QueryGetFidCidRequest, opts ...grpc.CallOption) (*QueryGetFidCidResponse, error) { + out := new(QueryGetFidCidResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/FidCid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) FidCidAll(ctx context.Context, in *QueryAllFidCidRequest, opts ...grpc.CallOption) (*QueryAllFidCidResponse, error) { + out := new(QueryAllFidCidResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/FidCidAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetPayData(ctx context.Context, in *QueryGetPayDataRequest, opts ...grpc.CallOption) (*QueryGetPayDataResponse, error) { + out := new(QueryGetPayDataResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Query/GetPayData", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a Contracts by index. + Contracts(context.Context, *QueryGetContractsRequest) (*QueryGetContractsResponse, error) + // Queries a list of Contracts items. + ContractsAll(context.Context, *QueryAllContractsRequest) (*QueryAllContractsResponse, error) + // Queries a ActiveDeals by index. + ActiveDeals(context.Context, *QueryGetActiveDealsRequest) (*QueryGetActiveDealsResponse, error) + // Queries a list of ActiveDeals items. + ActiveDealsAll(context.Context, *QueryAllActiveDealsRequest) (*QueryAllActiveDealsResponse, error) + // Queries a Providers by index. + Providers(context.Context, *QueryGetProvidersRequest) (*QueryGetProvidersResponse, error) + // Queries a list of Providers items. + ProvidersAll(context.Context, *QueryAllProvidersRequest) (*QueryAllProvidersResponse, error) + // Queries a list of Freespace items. + Freespace(context.Context, *QueryFreespaceRequest) (*QueryFreespaceResponse, error) + // Queries a list of FindFile items. + FindFile(context.Context, *QueryFindFileRequest) (*QueryFindFileResponse, error) + // Queries a PayBlocks by index. + PayBlocks(context.Context, *QueryGetPayBlocksRequest) (*QueryGetPayBlocksResponse, error) + // Queries a list of PayBlocks items. + PayBlocksAll(context.Context, *QueryAllPayBlocksRequest) (*QueryAllPayBlocksResponse, error) + // Queries a ClientUsage by index. + ClientUsage(context.Context, *QueryGetClientUsageRequest) (*QueryGetClientUsageResponse, error) + // Queries a list of ClientUsage items. + ClientUsageAll(context.Context, *QueryAllClientUsageRequest) (*QueryAllClientUsageResponse, error) + // Queries a Strays by index. + Strays(context.Context, *QueryGetStraysRequest) (*QueryGetStraysResponse, error) + // Queries a list of Strays items. + StraysAll(context.Context, *QueryAllStraysRequest) (*QueryAllStraysResponse, error) + // Queries a list of GetClientFreeSpace items. + GetClientFreeSpace(context.Context, *QueryGetClientFreeSpaceRequest) (*QueryGetClientFreeSpaceResponse, error) + // Queries a FidCid by index. + FidCid(context.Context, *QueryGetFidCidRequest) (*QueryGetFidCidResponse, error) + // Queries a list of FidCid items. + FidCidAll(context.Context, *QueryAllFidCidRequest) (*QueryAllFidCidResponse, error) + // Queries a list of GetPayData items. + GetPayData(context.Context, *QueryGetPayDataRequest) (*QueryGetPayDataResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) Contracts(ctx context.Context, req *QueryGetContractsRequest) (*QueryGetContractsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Contracts not implemented") +} +func (*UnimplementedQueryServer) ContractsAll(ctx context.Context, req *QueryAllContractsRequest) (*QueryAllContractsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ContractsAll not implemented") +} +func (*UnimplementedQueryServer) ActiveDeals(ctx context.Context, req *QueryGetActiveDealsRequest) (*QueryGetActiveDealsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ActiveDeals not implemented") +} +func (*UnimplementedQueryServer) ActiveDealsAll(ctx context.Context, req *QueryAllActiveDealsRequest) (*QueryAllActiveDealsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ActiveDealsAll not implemented") +} +func (*UnimplementedQueryServer) Providers(ctx context.Context, req *QueryGetProvidersRequest) (*QueryGetProvidersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Providers not implemented") +} +func (*UnimplementedQueryServer) ProvidersAll(ctx context.Context, req *QueryAllProvidersRequest) (*QueryAllProvidersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProvidersAll not implemented") +} +func (*UnimplementedQueryServer) Freespace(ctx context.Context, req *QueryFreespaceRequest) (*QueryFreespaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Freespace not implemented") +} +func (*UnimplementedQueryServer) FindFile(ctx context.Context, req *QueryFindFileRequest) (*QueryFindFileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindFile not implemented") +} +func (*UnimplementedQueryServer) PayBlocks(ctx context.Context, req *QueryGetPayBlocksRequest) (*QueryGetPayBlocksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PayBlocks not implemented") +} +func (*UnimplementedQueryServer) PayBlocksAll(ctx context.Context, req *QueryAllPayBlocksRequest) (*QueryAllPayBlocksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PayBlocksAll not implemented") +} +func (*UnimplementedQueryServer) ClientUsage(ctx context.Context, req *QueryGetClientUsageRequest) (*QueryGetClientUsageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClientUsage not implemented") +} +func (*UnimplementedQueryServer) ClientUsageAll(ctx context.Context, req *QueryAllClientUsageRequest) (*QueryAllClientUsageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClientUsageAll not implemented") +} +func (*UnimplementedQueryServer) Strays(ctx context.Context, req *QueryGetStraysRequest) (*QueryGetStraysResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Strays not implemented") +} +func (*UnimplementedQueryServer) StraysAll(ctx context.Context, req *QueryAllStraysRequest) (*QueryAllStraysResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StraysAll not implemented") +} +func (*UnimplementedQueryServer) GetClientFreeSpace(ctx context.Context, req *QueryGetClientFreeSpaceRequest) (*QueryGetClientFreeSpaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetClientFreeSpace not implemented") +} +func (*UnimplementedQueryServer) FidCid(ctx context.Context, req *QueryGetFidCidRequest) (*QueryGetFidCidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FidCid not implemented") +} +func (*UnimplementedQueryServer) FidCidAll(ctx context.Context, req *QueryAllFidCidRequest) (*QueryAllFidCidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FidCidAll not implemented") +} +func (*UnimplementedQueryServer) GetPayData(ctx context.Context, req *QueryGetPayDataRequest) (*QueryGetPayDataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPayData not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Contracts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetContractsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Contracts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/Contracts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Contracts(ctx, req.(*QueryGetContractsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ContractsAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllContractsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ContractsAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/ContractsAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ContractsAll(ctx, req.(*QueryAllContractsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ActiveDeals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetActiveDealsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ActiveDeals(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/ActiveDeals", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ActiveDeals(ctx, req.(*QueryGetActiveDealsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ActiveDealsAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllActiveDealsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ActiveDealsAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/ActiveDealsAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ActiveDealsAll(ctx, req.(*QueryAllActiveDealsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Providers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetProvidersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Providers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/Providers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Providers(ctx, req.(*QueryGetProvidersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ProvidersAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllProvidersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ProvidersAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/ProvidersAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ProvidersAll(ctx, req.(*QueryAllProvidersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Freespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryFreespaceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Freespace(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/Freespace", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Freespace(ctx, req.(*QueryFreespaceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_FindFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryFindFileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).FindFile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/FindFile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).FindFile(ctx, req.(*QueryFindFileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_PayBlocks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetPayBlocksRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PayBlocks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/PayBlocks", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PayBlocks(ctx, req.(*QueryGetPayBlocksRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_PayBlocksAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllPayBlocksRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PayBlocksAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/PayBlocksAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PayBlocksAll(ctx, req.(*QueryAllPayBlocksRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ClientUsage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetClientUsageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ClientUsage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/ClientUsage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ClientUsage(ctx, req.(*QueryGetClientUsageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ClientUsageAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllClientUsageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ClientUsageAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/ClientUsageAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ClientUsageAll(ctx, req.(*QueryAllClientUsageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Strays_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetStraysRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Strays(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/Strays", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Strays(ctx, req.(*QueryGetStraysRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_StraysAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllStraysRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).StraysAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/StraysAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).StraysAll(ctx, req.(*QueryAllStraysRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetClientFreeSpace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetClientFreeSpaceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetClientFreeSpace(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/GetClientFreeSpace", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetClientFreeSpace(ctx, req.(*QueryGetClientFreeSpaceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_FidCid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetFidCidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).FidCid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/FidCid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).FidCid(ctx, req.(*QueryGetFidCidRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_FidCidAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllFidCidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).FidCidAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/FidCidAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).FidCidAll(ctx, req.(*QueryAllFidCidRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetPayData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetPayDataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetPayData(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Query/GetPayData", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetPayData(ctx, req.(*QueryGetPayDataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "jackaldao.canine.storage.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Contracts", + Handler: _Query_Contracts_Handler, + }, + { + MethodName: "ContractsAll", + Handler: _Query_ContractsAll_Handler, + }, + { + MethodName: "ActiveDeals", + Handler: _Query_ActiveDeals_Handler, + }, + { + MethodName: "ActiveDealsAll", + Handler: _Query_ActiveDealsAll_Handler, + }, + { + MethodName: "Providers", + Handler: _Query_Providers_Handler, + }, + { + MethodName: "ProvidersAll", + Handler: _Query_ProvidersAll_Handler, + }, + { + MethodName: "Freespace", + Handler: _Query_Freespace_Handler, + }, + { + MethodName: "FindFile", + Handler: _Query_FindFile_Handler, + }, + { + MethodName: "PayBlocks", + Handler: _Query_PayBlocks_Handler, + }, + { + MethodName: "PayBlocksAll", + Handler: _Query_PayBlocksAll_Handler, + }, + { + MethodName: "ClientUsage", + Handler: _Query_ClientUsage_Handler, + }, + { + MethodName: "ClientUsageAll", + Handler: _Query_ClientUsageAll_Handler, + }, + { + MethodName: "Strays", + Handler: _Query_Strays_Handler, + }, + { + MethodName: "StraysAll", + Handler: _Query_StraysAll_Handler, + }, + { + MethodName: "GetClientFreeSpace", + Handler: _Query_GetClientFreeSpace_Handler, + }, + { + MethodName: "FidCid", + Handler: _Query_FidCid_Handler, + }, + { + MethodName: "FidCidAll", + Handler: _Query_FidCidAll_Handler, + }, + { + MethodName: "GetPayData", + Handler: _Query_GetPayData_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "canine-chain/storage/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.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 *QueryGetContractsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetContractsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetContractsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetContractsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetContractsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetContractsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Contracts.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 *QueryAllContractsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllContractsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllContractsRequest) 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 *QueryAllContractsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllContractsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllContractsResponse) 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-- { + { + size, err := m.Contracts[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 *QueryGetActiveDealsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetActiveDealsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetActiveDealsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetActiveDealsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetActiveDealsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetActiveDealsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ActiveDeals.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 *QueryAllActiveDealsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllActiveDealsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllActiveDealsRequest) 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 *QueryAllActiveDealsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllActiveDealsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllActiveDealsResponse) 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.ActiveDeals) > 0 { + for iNdEx := len(m.ActiveDeals) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ActiveDeals[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 *QueryGetProvidersRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetProvidersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetProvidersRequest) 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 *QueryGetProvidersResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetProvidersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetProvidersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Providers.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 *QueryAllProvidersRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllProvidersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllProvidersRequest) 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 *QueryAllProvidersResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllProvidersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllProvidersResponse) 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.Providers) > 0 { + for iNdEx := len(m.Providers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Providers[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 *QueryFreespaceRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFreespaceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFreespaceRequest) 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 *QueryFreespaceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFreespaceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFreespaceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Space) > 0 { + i -= len(m.Space) + copy(dAtA[i:], m.Space) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Space))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryFindFileRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFindFileRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFindFileRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Fid) > 0 { + i -= len(m.Fid) + copy(dAtA[i:], m.Fid) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Fid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryFindFileResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFindFileResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFindFileResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ProviderIps) > 0 { + i -= len(m.ProviderIps) + copy(dAtA[i:], m.ProviderIps) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ProviderIps))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetPayBlocksRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetPayBlocksRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPayBlocksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Blockid) > 0 { + i -= len(m.Blockid) + copy(dAtA[i:], m.Blockid) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Blockid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetPayBlocksResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetPayBlocksResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPayBlocksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PayBlocks.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 *QueryAllPayBlocksRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllPayBlocksRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllPayBlocksRequest) 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 *QueryAllPayBlocksResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllPayBlocksResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllPayBlocksResponse) 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.PayBlocks) > 0 { + for iNdEx := len(m.PayBlocks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PayBlocks[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 *QueryGetClientUsageRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetClientUsageRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetClientUsageRequest) 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 *QueryGetClientUsageResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetClientUsageResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetClientUsageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ClientUsage.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 *QueryAllClientUsageRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllClientUsageRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllClientUsageRequest) 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 *QueryAllClientUsageResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllClientUsageResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllClientUsageResponse) 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.ClientUsage) > 0 { + for iNdEx := len(m.ClientUsage) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ClientUsage[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 *QueryGetStraysRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetStraysRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetStraysRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetStraysResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetStraysResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetStraysResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Strays.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 *QueryAllStraysRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllStraysRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllStraysRequest) 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 *QueryAllStraysResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllStraysResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllStraysResponse) 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.Strays) > 0 { + for iNdEx := len(m.Strays) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Strays[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 *QueryGetClientFreeSpaceRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetClientFreeSpaceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetClientFreeSpaceRequest) 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 *QueryGetClientFreeSpaceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetClientFreeSpaceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetClientFreeSpaceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Bytesfree) > 0 { + i -= len(m.Bytesfree) + copy(dAtA[i:], m.Bytesfree) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bytesfree))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetFidCidRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetFidCidRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetFidCidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Fid) > 0 { + i -= len(m.Fid) + copy(dAtA[i:], m.Fid) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Fid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetFidCidResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetFidCidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetFidCidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.FidCid.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 *QueryAllFidCidRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllFidCidRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllFidCidRequest) 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 *QueryAllFidCidResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllFidCidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllFidCidResponse) 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.FidCid) > 0 { + for iNdEx := len(m.FidCid) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FidCid[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 *QueryGetPayDataRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetPayDataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPayDataRequest) 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 *QueryGetPayDataResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetPayDataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPayDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Bytes != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Bytes)) + i-- + dAtA[i] = 0x10 + } + if m.BlocksRemaining != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlocksRemaining)) + i-- + dAtA[i] = 0x8 + } + 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 *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetContractsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetContractsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Contracts.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllContractsRequest) 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 *QueryAllContractsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Contracts) > 0 { + for _, e := range m.Contracts { + 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 *QueryGetActiveDealsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetActiveDealsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ActiveDeals.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllActiveDealsRequest) 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 *QueryAllActiveDealsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ActiveDeals) > 0 { + for _, e := range m.ActiveDeals { + 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 *QueryGetProvidersRequest) 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 *QueryGetProvidersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Providers.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllProvidersRequest) 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 *QueryAllProvidersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Providers) > 0 { + for _, e := range m.Providers { + 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 *QueryFreespaceRequest) 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 *QueryFreespaceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Space) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryFindFileRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Fid) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryFindFileResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProviderIps) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetPayBlocksRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Blockid) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetPayBlocksResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PayBlocks.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllPayBlocksRequest) 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 *QueryAllPayBlocksResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PayBlocks) > 0 { + for _, e := range m.PayBlocks { + 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 *QueryGetClientUsageRequest) 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 *QueryGetClientUsageResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ClientUsage.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllClientUsageRequest) 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 *QueryAllClientUsageResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ClientUsage) > 0 { + for _, e := range m.ClientUsage { + 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 *QueryGetStraysRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetStraysResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Strays.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllStraysRequest) 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 *QueryAllStraysResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Strays) > 0 { + for _, e := range m.Strays { + 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 *QueryGetClientFreeSpaceRequest) 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 *QueryGetClientFreeSpaceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bytesfree) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetFidCidRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Fid) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetFidCidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.FidCid.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllFidCidRequest) 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 *QueryAllFidCidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.FidCid) > 0 { + for _, e := range m.FidCid { + 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 *QueryGetPayDataRequest) 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 *QueryGetPayDataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlocksRemaining != 0 { + n += 1 + sovQuery(uint64(m.BlocksRemaining)) + } + if m.Bytes != 0 { + n += 1 + sovQuery(uint64(m.Bytes)) + } + 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 *QueryParamsRequest) Unmarshal(dAtA []byte) 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryParamsResponse) Unmarshal(dAtA []byte) 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: 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 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.Params.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 *QueryGetContractsRequest) Unmarshal(dAtA []byte) 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: QueryGetContractsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetContractsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", 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.Cid = 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 *QueryGetContractsResponse) Unmarshal(dAtA []byte) 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: QueryGetContractsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetContractsResponse: 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 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.Contracts.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 *QueryAllContractsRequest) Unmarshal(dAtA []byte) 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: QueryAllContractsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllContractsRequest: 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 *QueryAllContractsResponse) Unmarshal(dAtA []byte) 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: QueryAllContractsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllContractsResponse: 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 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.Contracts = append(m.Contracts, Contracts{}) + if err := m.Contracts[len(m.Contracts)-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 *QueryGetActiveDealsRequest) Unmarshal(dAtA []byte) 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: QueryGetActiveDealsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetActiveDealsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", 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.Cid = 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 *QueryGetActiveDealsResponse) Unmarshal(dAtA []byte) 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: QueryGetActiveDealsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetActiveDealsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveDeals", 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.ActiveDeals.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 *QueryAllActiveDealsRequest) Unmarshal(dAtA []byte) 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: QueryAllActiveDealsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllActiveDealsRequest: 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 *QueryAllActiveDealsResponse) Unmarshal(dAtA []byte) 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: QueryAllActiveDealsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllActiveDealsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveDeals", 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.ActiveDeals = append(m.ActiveDeals, ActiveDeals{}) + if err := m.ActiveDeals[len(m.ActiveDeals)-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 *QueryGetProvidersRequest) Unmarshal(dAtA []byte) 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: QueryGetProvidersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetProvidersRequest: 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 *QueryGetProvidersResponse) Unmarshal(dAtA []byte) 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: QueryGetProvidersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetProvidersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Providers", 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.Providers.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 *QueryAllProvidersRequest) Unmarshal(dAtA []byte) 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: QueryAllProvidersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllProvidersRequest: 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 *QueryAllProvidersResponse) Unmarshal(dAtA []byte) 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: QueryAllProvidersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllProvidersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Providers", 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.Providers = append(m.Providers, Providers{}) + if err := m.Providers[len(m.Providers)-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 *QueryFreespaceRequest) Unmarshal(dAtA []byte) 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: QueryFreespaceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFreespaceRequest: 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 *QueryFreespaceResponse) Unmarshal(dAtA []byte) 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: QueryFreespaceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFreespaceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Space", 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.Space = 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 *QueryFindFileRequest) Unmarshal(dAtA []byte) 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: QueryFindFileRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFindFileRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fid", 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.Fid = 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 *QueryFindFileResponse) Unmarshal(dAtA []byte) 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: QueryFindFileResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFindFileResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderIps", 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.ProviderIps = 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 *QueryGetPayBlocksRequest) Unmarshal(dAtA []byte) 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: QueryGetPayBlocksRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPayBlocksRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blockid", 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.Blockid = 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 *QueryGetPayBlocksResponse) Unmarshal(dAtA []byte) 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: QueryGetPayBlocksResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPayBlocksResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayBlocks", 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.PayBlocks.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 *QueryAllPayBlocksRequest) Unmarshal(dAtA []byte) 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: QueryAllPayBlocksRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllPayBlocksRequest: 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 *QueryAllPayBlocksResponse) Unmarshal(dAtA []byte) 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: QueryAllPayBlocksResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllPayBlocksResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayBlocks", 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.PayBlocks = append(m.PayBlocks, PayBlocks{}) + if err := m.PayBlocks[len(m.PayBlocks)-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 *QueryGetClientUsageRequest) Unmarshal(dAtA []byte) 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: QueryGetClientUsageRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetClientUsageRequest: 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 *QueryGetClientUsageResponse) Unmarshal(dAtA []byte) 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: QueryGetClientUsageResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetClientUsageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientUsage", 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.ClientUsage.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 *QueryAllClientUsageRequest) Unmarshal(dAtA []byte) 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: QueryAllClientUsageRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllClientUsageRequest: 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 *QueryAllClientUsageResponse) Unmarshal(dAtA []byte) 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: QueryAllClientUsageResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllClientUsageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientUsage", 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.ClientUsage = append(m.ClientUsage, ClientUsage{}) + if err := m.ClientUsage[len(m.ClientUsage)-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 *QueryGetStraysRequest) Unmarshal(dAtA []byte) 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: QueryGetStraysRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetStraysRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", 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.Cid = 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 *QueryGetStraysResponse) Unmarshal(dAtA []byte) 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: QueryGetStraysResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetStraysResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Strays", 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.Strays.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 *QueryAllStraysRequest) Unmarshal(dAtA []byte) 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: QueryAllStraysRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllStraysRequest: 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 *QueryAllStraysResponse) Unmarshal(dAtA []byte) 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: QueryAllStraysResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllStraysResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Strays", 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.Strays = append(m.Strays, Strays{}) + if err := m.Strays[len(m.Strays)-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 *QueryGetClientFreeSpaceRequest) Unmarshal(dAtA []byte) 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: QueryGetClientFreeSpaceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetClientFreeSpaceRequest: 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 *QueryGetClientFreeSpaceResponse) Unmarshal(dAtA []byte) 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: QueryGetClientFreeSpaceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetClientFreeSpaceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bytesfree", 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.Bytesfree = 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 *QueryGetFidCidRequest) Unmarshal(dAtA []byte) 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: QueryGetFidCidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetFidCidRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fid", 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.Fid = 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 *QueryGetFidCidResponse) Unmarshal(dAtA []byte) 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: QueryGetFidCidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetFidCidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FidCid", 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.FidCid.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 *QueryAllFidCidRequest) Unmarshal(dAtA []byte) 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: QueryAllFidCidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllFidCidRequest: 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 *QueryAllFidCidResponse) Unmarshal(dAtA []byte) 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: QueryAllFidCidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllFidCidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FidCid", 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.FidCid = append(m.FidCid, FidCid{}) + if err := m.FidCid[len(m.FidCid)-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 *QueryGetPayDataRequest) Unmarshal(dAtA []byte) 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: QueryGetPayDataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPayDataRequest: 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 *QueryGetPayDataResponse) Unmarshal(dAtA []byte) 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: QueryGetPayDataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPayDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksRemaining", wireType) + } + m.BlocksRemaining = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlocksRemaining |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType) + } + m.Bytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Bytes |= int64(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 skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/storage/types/query.pb.gw.go b/x/storage/types/query.pb.gw.go new file mode 100644 index 000000000..854e52196 --- /dev/null +++ b/x/storage/types/query.pb.gw.go @@ -0,0 +1,1845 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: canine-chain/storage/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/metadata" + "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 +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Contracts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetContractsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["cid"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "cid") + } + + protoReq.Cid, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "cid", err) + } + + msg, err := client.Contracts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Contracts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetContractsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["cid"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "cid") + } + + protoReq.Cid, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "cid", err) + } + + msg, err := server.Contracts(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ContractsAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ContractsAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllContractsRequest + 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_ContractsAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ContractsAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ContractsAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllContractsRequest + 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_ContractsAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ContractsAll(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_ActiveDeals_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetActiveDealsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["cid"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "cid") + } + + protoReq.Cid, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "cid", err) + } + + msg, err := client.ActiveDeals(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ActiveDeals_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetActiveDealsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["cid"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "cid") + } + + protoReq.Cid, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "cid", err) + } + + msg, err := server.ActiveDeals(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ActiveDealsAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ActiveDealsAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllActiveDealsRequest + 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_ActiveDealsAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ActiveDealsAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ActiveDealsAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllActiveDealsRequest + 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_ActiveDealsAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ActiveDealsAll(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Providers_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetProvidersRequest + 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.Providers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Providers_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetProvidersRequest + 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.Providers(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ProvidersAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ProvidersAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllProvidersRequest + 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_ProvidersAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ProvidersAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ProvidersAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllProvidersRequest + 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_ProvidersAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ProvidersAll(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Freespace_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFreespaceRequest + 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.Freespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Freespace_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFreespaceRequest + 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.Freespace(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_FindFile_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFindFileRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["fid"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "fid") + } + + protoReq.Fid, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "fid", err) + } + + msg, err := client.FindFile(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_FindFile_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFindFileRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["fid"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "fid") + } + + protoReq.Fid, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "fid", err) + } + + msg, err := server.FindFile(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_PayBlocks_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetPayBlocksRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["blockid"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "blockid") + } + + protoReq.Blockid, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "blockid", err) + } + + msg, err := client.PayBlocks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_PayBlocks_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetPayBlocksRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["blockid"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "blockid") + } + + protoReq.Blockid, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "blockid", err) + } + + msg, err := server.PayBlocks(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_PayBlocksAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_PayBlocksAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllPayBlocksRequest + 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_PayBlocksAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.PayBlocksAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_PayBlocksAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllPayBlocksRequest + 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_PayBlocksAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.PayBlocksAll(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_ClientUsage_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetClientUsageRequest + 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.ClientUsage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ClientUsage_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetClientUsageRequest + 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.ClientUsage(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ClientUsageAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ClientUsageAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllClientUsageRequest + 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_ClientUsageAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ClientUsageAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ClientUsageAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllClientUsageRequest + 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_ClientUsageAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ClientUsageAll(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Strays_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetStraysRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["cid"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "cid") + } + + protoReq.Cid, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "cid", err) + } + + msg, err := client.Strays(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Strays_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetStraysRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["cid"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "cid") + } + + protoReq.Cid, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "cid", err) + } + + msg, err := server.Strays(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_StraysAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_StraysAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllStraysRequest + 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_StraysAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.StraysAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_StraysAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllStraysRequest + 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_StraysAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.StraysAll(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_GetClientFreeSpace_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetClientFreeSpaceRequest + 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.GetClientFreeSpace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetClientFreeSpace_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetClientFreeSpaceRequest + 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.GetClientFreeSpace(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_FidCid_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetFidCidRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["fid"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "fid") + } + + protoReq.Fid, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "fid", err) + } + + msg, err := client.FidCid(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_FidCid_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetFidCidRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["fid"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "fid") + } + + protoReq.Fid, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "fid", err) + } + + msg, err := server.FidCid(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_FidCidAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_FidCidAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllFidCidRequest + 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_FidCidAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.FidCidAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_FidCidAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllFidCidRequest + 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_FidCidAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.FidCidAll(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_GetPayData_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetPayDataRequest + 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.GetPayData(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetPayData_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetPayDataRequest + 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.GetPayData(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 to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Contracts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_Contracts_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Contracts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ContractsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_ContractsAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ContractsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ActiveDeals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_ActiveDeals_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ActiveDeals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ActiveDealsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_ActiveDealsAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ActiveDealsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Providers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_Providers_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Providers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ProvidersAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_ProvidersAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ProvidersAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Freespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_Freespace_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Freespace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_FindFile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_FindFile_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_FindFile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_PayBlocks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_PayBlocks_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_PayBlocks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_PayBlocksAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_PayBlocksAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_PayBlocksAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ClientUsage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_ClientUsage_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ClientUsage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ClientUsageAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_ClientUsageAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ClientUsageAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Strays_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_Strays_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Strays_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_StraysAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_StraysAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_StraysAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetClientFreeSpace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_GetClientFreeSpace_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetClientFreeSpace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_FidCid_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_FidCid_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_FidCid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_FidCidAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_FidCidAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_FidCidAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetPayData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + 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_GetPayData_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetPayData_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_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Contracts_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_Contracts_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_Contracts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ContractsAll_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_ContractsAll_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_ContractsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ActiveDeals_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_ActiveDeals_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_ActiveDeals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ActiveDealsAll_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_ActiveDealsAll_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_ActiveDealsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Providers_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_Providers_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_Providers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ProvidersAll_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_ProvidersAll_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_ProvidersAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Freespace_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_Freespace_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_Freespace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_FindFile_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_FindFile_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_FindFile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_PayBlocks_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_PayBlocks_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_PayBlocks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_PayBlocksAll_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_PayBlocksAll_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_PayBlocksAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ClientUsage_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_ClientUsage_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_ClientUsage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ClientUsageAll_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_ClientUsageAll_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_ClientUsageAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Strays_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_Strays_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_Strays_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_StraysAll_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_StraysAll_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_StraysAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetClientFreeSpace_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_GetClientFreeSpace_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_GetClientFreeSpace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_FidCid_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_FidCid_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_FidCid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_FidCidAll_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_FidCidAll_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_FidCidAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetPayData_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_GetPayData_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_GetPayData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "storage", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Contracts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "storage", "contracts", "cid"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ContractsAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "storage", "contracts"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ActiveDeals_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "storage", "active_deals", "cid"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ActiveDealsAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "storage", "active_deals"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Providers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "storage", "providers", "address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ProvidersAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "storage", "providers"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Freespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "storage", "freespace", "address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_FindFile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "storage", "find_file", "fid"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_PayBlocks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "storage", "pay_blocks", "blockid"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_PayBlocksAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "storage", "pay_blocks"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ClientUsage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "storage", "client_usage", "address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ClientUsageAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "storage", "client_usage"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Strays_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "storage", "strays", "cid"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_StraysAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "storage", "strays"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GetClientFreeSpace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "storage", "get_client_free_space", "address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_FidCid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "storage", "fid_cid", "fid"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_FidCidAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine", "storage", "fid_cid"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GetPayData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine", "storage", "get_pay_data", "address"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Contracts_0 = runtime.ForwardResponseMessage + + forward_Query_ContractsAll_0 = runtime.ForwardResponseMessage + + forward_Query_ActiveDeals_0 = runtime.ForwardResponseMessage + + forward_Query_ActiveDealsAll_0 = runtime.ForwardResponseMessage + + forward_Query_Providers_0 = runtime.ForwardResponseMessage + + forward_Query_ProvidersAll_0 = runtime.ForwardResponseMessage + + forward_Query_Freespace_0 = runtime.ForwardResponseMessage + + forward_Query_FindFile_0 = runtime.ForwardResponseMessage + + forward_Query_PayBlocks_0 = runtime.ForwardResponseMessage + + forward_Query_PayBlocksAll_0 = runtime.ForwardResponseMessage + + forward_Query_ClientUsage_0 = runtime.ForwardResponseMessage + + forward_Query_ClientUsageAll_0 = runtime.ForwardResponseMessage + + forward_Query_Strays_0 = runtime.ForwardResponseMessage + + forward_Query_StraysAll_0 = runtime.ForwardResponseMessage + + forward_Query_GetClientFreeSpace_0 = runtime.ForwardResponseMessage + + forward_Query_FidCid_0 = runtime.ForwardResponseMessage + + forward_Query_FidCidAll_0 = runtime.ForwardResponseMessage + + forward_Query_GetPayData_0 = runtime.ForwardResponseMessage +) diff --git a/x/storage/types/strays.pb.go b/x/storage/types/strays.pb.go new file mode 100644 index 000000000..239bf1e23 --- /dev/null +++ b/x/storage/types/strays.pb.go @@ -0,0 +1,522 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: canine-chain/storage/strays.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Strays struct { + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` + Fid string `protobuf:"bytes,2,opt,name=fid,proto3" json:"fid,omitempty"` + Signee string `protobuf:"bytes,3,opt,name=signee,proto3" json:"signee,omitempty"` + Filesize string `protobuf:"bytes,4,opt,name=filesize,proto3" json:"filesize,omitempty"` + Merkle string `protobuf:"bytes,5,opt,name=merkle,proto3" json:"merkle,omitempty"` +} + +func (m *Strays) Reset() { *m = Strays{} } +func (m *Strays) String() string { return proto.CompactTextString(m) } +func (*Strays) ProtoMessage() {} +func (*Strays) Descriptor() ([]byte, []int) { + return fileDescriptor_13b617139f894aaa, []int{0} +} +func (m *Strays) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Strays) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Strays.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Strays) XXX_Merge(src proto.Message) { + xxx_messageInfo_Strays.Merge(m, src) +} +func (m *Strays) XXX_Size() int { + return m.Size() +} +func (m *Strays) XXX_DiscardUnknown() { + xxx_messageInfo_Strays.DiscardUnknown(m) +} + +var xxx_messageInfo_Strays proto.InternalMessageInfo + +func (m *Strays) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +func (m *Strays) GetFid() string { + if m != nil { + return m.Fid + } + return "" +} + +func (m *Strays) GetSignee() string { + if m != nil { + return m.Signee + } + return "" +} + +func (m *Strays) GetFilesize() string { + if m != nil { + return m.Filesize + } + return "" +} + +func (m *Strays) GetMerkle() string { + if m != nil { + return m.Merkle + } + return "" +} + +func init() { + proto.RegisterType((*Strays)(nil), "jackaldao.canine.storage.Strays") +} + +func init() { proto.RegisterFile("canine-chain/storage/strays.proto", fileDescriptor_13b617139f894aaa) } + +var fileDescriptor_13b617139f894aaa = []byte{ + // 222 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0x4e, 0xcc, 0xcb, + 0xcc, 0x4b, 0xd5, 0x4d, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x2f, 0x2e, 0xc9, 0x2f, 0x4a, 0x4c, 0x4f, + 0xd5, 0x2f, 0x2e, 0x29, 0x4a, 0xac, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xc8, + 0x4a, 0x4c, 0xce, 0x4e, 0xcc, 0x49, 0x49, 0xcc, 0xd7, 0x83, 0x28, 0xd6, 0x83, 0x2a, 0x53, 0xaa, + 0xe0, 0x62, 0x0b, 0x06, 0xab, 0x14, 0x12, 0xe0, 0x62, 0x4e, 0xce, 0x4c, 0x91, 0x60, 0x54, 0x60, + 0xd4, 0xe0, 0x0c, 0x02, 0x31, 0x41, 0x22, 0x69, 0x99, 0x29, 0x12, 0x4c, 0x10, 0x91, 0xb4, 0xcc, + 0x14, 0x21, 0x31, 0x2e, 0xb6, 0xe2, 0xcc, 0xf4, 0xbc, 0xd4, 0x54, 0x09, 0x66, 0xb0, 0x20, 0x94, + 0x27, 0x24, 0xc5, 0xc5, 0x91, 0x96, 0x99, 0x93, 0x5a, 0x9c, 0x59, 0x95, 0x2a, 0xc1, 0x02, 0x96, + 0x81, 0xf3, 0x41, 0x7a, 0x72, 0x53, 0x8b, 0xb2, 0x73, 0x52, 0x25, 0x58, 0x21, 0x7a, 0x20, 0x3c, + 0x27, 0xb7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, + 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x49, 0xcf, 0x2c, + 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87, 0x38, 0x5c, 0x37, 0x25, 0x31, 0x5f, 0x1f, + 0xe2, 0x72, 0xfd, 0x0a, 0xb8, 0x17, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x5e, 0x34, + 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xeb, 0xd3, 0x51, 0x95, 0x07, 0x01, 0x00, 0x00, +} + +func (m *Strays) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Strays) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Strays) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Merkle) > 0 { + i -= len(m.Merkle) + copy(dAtA[i:], m.Merkle) + i = encodeVarintStrays(dAtA, i, uint64(len(m.Merkle))) + i-- + dAtA[i] = 0x2a + } + if len(m.Filesize) > 0 { + i -= len(m.Filesize) + copy(dAtA[i:], m.Filesize) + i = encodeVarintStrays(dAtA, i, uint64(len(m.Filesize))) + i-- + dAtA[i] = 0x22 + } + if len(m.Signee) > 0 { + i -= len(m.Signee) + copy(dAtA[i:], m.Signee) + i = encodeVarintStrays(dAtA, i, uint64(len(m.Signee))) + i-- + dAtA[i] = 0x1a + } + if len(m.Fid) > 0 { + i -= len(m.Fid) + copy(dAtA[i:], m.Fid) + i = encodeVarintStrays(dAtA, i, uint64(len(m.Fid))) + i-- + dAtA[i] = 0x12 + } + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintStrays(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintStrays(dAtA []byte, offset int, v uint64) int { + offset -= sovStrays(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Strays) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovStrays(uint64(l)) + } + l = len(m.Fid) + if l > 0 { + n += 1 + l + sovStrays(uint64(l)) + } + l = len(m.Signee) + if l > 0 { + n += 1 + l + sovStrays(uint64(l)) + } + l = len(m.Filesize) + if l > 0 { + n += 1 + l + sovStrays(uint64(l)) + } + l = len(m.Merkle) + if l > 0 { + n += 1 + l + sovStrays(uint64(l)) + } + return n +} + +func sovStrays(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozStrays(x uint64) (n int) { + return sovStrays(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Strays) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStrays + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Strays: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Strays: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStrays + } + 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 ErrInvalidLengthStrays + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStrays + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStrays + } + 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 ErrInvalidLengthStrays + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStrays + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStrays + } + 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 ErrInvalidLengthStrays + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStrays + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filesize", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStrays + } + 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 ErrInvalidLengthStrays + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStrays + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Filesize = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Merkle", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStrays + } + 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 ErrInvalidLengthStrays + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStrays + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Merkle = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStrays(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStrays + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipStrays(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, ErrIntOverflowStrays + } + 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, ErrIntOverflowStrays + } + 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, ErrIntOverflowStrays + } + 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, ErrInvalidLengthStrays + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStrays + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthStrays + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthStrays = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStrays = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStrays = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/storage/types/tx.pb.go b/x/storage/types/tx.pb.go new file mode 100644 index 000000000..f49bd537e --- /dev/null +++ b/x/storage/types/tx.pb.go @@ -0,0 +1,4120 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: canine-chain/storage/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + 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 + +type MsgPostContract struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Merkle string `protobuf:"bytes,2,opt,name=merkle,proto3" json:"merkle,omitempty"` + Signee string `protobuf:"bytes,3,opt,name=signee,proto3" json:"signee,omitempty"` + Filesize string `protobuf:"bytes,4,opt,name=filesize,proto3" json:"filesize,omitempty"` + Fid string `protobuf:"bytes,5,opt,name=fid,proto3" json:"fid,omitempty"` +} + +func (m *MsgPostContract) Reset() { *m = MsgPostContract{} } +func (m *MsgPostContract) String() string { return proto.CompactTextString(m) } +func (*MsgPostContract) ProtoMessage() {} +func (*MsgPostContract) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{0} +} +func (m *MsgPostContract) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPostContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPostContract.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPostContract) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPostContract.Merge(m, src) +} +func (m *MsgPostContract) XXX_Size() int { + return m.Size() +} +func (m *MsgPostContract) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPostContract.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPostContract proto.InternalMessageInfo + +func (m *MsgPostContract) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgPostContract) GetMerkle() string { + if m != nil { + return m.Merkle + } + return "" +} + +func (m *MsgPostContract) GetSignee() string { + if m != nil { + return m.Signee + } + return "" +} + +func (m *MsgPostContract) GetFilesize() string { + if m != nil { + return m.Filesize + } + return "" +} + +func (m *MsgPostContract) GetFid() string { + if m != nil { + return m.Fid + } + return "" +} + +type MsgPostContractResponse struct { +} + +func (m *MsgPostContractResponse) Reset() { *m = MsgPostContractResponse{} } +func (m *MsgPostContractResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPostContractResponse) ProtoMessage() {} +func (*MsgPostContractResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{1} +} +func (m *MsgPostContractResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPostContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPostContractResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPostContractResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPostContractResponse.Merge(m, src) +} +func (m *MsgPostContractResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPostContractResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPostContractResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPostContractResponse proto.InternalMessageInfo + +type MsgPostproof struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Item string `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` + Hashlist string `protobuf:"bytes,3,opt,name=hashlist,proto3" json:"hashlist,omitempty"` + Cid string `protobuf:"bytes,4,opt,name=cid,proto3" json:"cid,omitempty"` +} + +func (m *MsgPostproof) Reset() { *m = MsgPostproof{} } +func (m *MsgPostproof) String() string { return proto.CompactTextString(m) } +func (*MsgPostproof) ProtoMessage() {} +func (*MsgPostproof) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{2} +} +func (m *MsgPostproof) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPostproof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPostproof.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPostproof) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPostproof.Merge(m, src) +} +func (m *MsgPostproof) XXX_Size() int { + return m.Size() +} +func (m *MsgPostproof) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPostproof.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPostproof proto.InternalMessageInfo + +func (m *MsgPostproof) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgPostproof) GetItem() string { + if m != nil { + return m.Item + } + return "" +} + +func (m *MsgPostproof) GetHashlist() string { + if m != nil { + return m.Hashlist + } + return "" +} + +func (m *MsgPostproof) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +type MsgPostproofResponse struct { + Merkle string `protobuf:"bytes,1,opt,name=merkle,proto3" json:"merkle,omitempty"` +} + +func (m *MsgPostproofResponse) Reset() { *m = MsgPostproofResponse{} } +func (m *MsgPostproofResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPostproofResponse) ProtoMessage() {} +func (*MsgPostproofResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{3} +} +func (m *MsgPostproofResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPostproofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPostproofResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPostproofResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPostproofResponse.Merge(m, src) +} +func (m *MsgPostproofResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPostproofResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPostproofResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPostproofResponse proto.InternalMessageInfo + +func (m *MsgPostproofResponse) GetMerkle() string { + if m != nil { + return m.Merkle + } + return "" +} + +type MsgSignContract struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Cid string `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid,omitempty"` +} + +func (m *MsgSignContract) Reset() { *m = MsgSignContract{} } +func (m *MsgSignContract) String() string { return proto.CompactTextString(m) } +func (*MsgSignContract) ProtoMessage() {} +func (*MsgSignContract) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{4} +} +func (m *MsgSignContract) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSignContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSignContract.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSignContract) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSignContract.Merge(m, src) +} +func (m *MsgSignContract) XXX_Size() int { + return m.Size() +} +func (m *MsgSignContract) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSignContract.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSignContract proto.InternalMessageInfo + +func (m *MsgSignContract) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgSignContract) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +type MsgSignContractResponse struct { +} + +func (m *MsgSignContractResponse) Reset() { *m = MsgSignContractResponse{} } +func (m *MsgSignContractResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSignContractResponse) ProtoMessage() {} +func (*MsgSignContractResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{5} +} +func (m *MsgSignContractResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSignContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSignContractResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSignContractResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSignContractResponse.Merge(m, src) +} +func (m *MsgSignContractResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSignContractResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSignContractResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSignContractResponse proto.InternalMessageInfo + +type MsgSetProviderIP struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` +} + +func (m *MsgSetProviderIP) Reset() { *m = MsgSetProviderIP{} } +func (m *MsgSetProviderIP) String() string { return proto.CompactTextString(m) } +func (*MsgSetProviderIP) ProtoMessage() {} +func (*MsgSetProviderIP) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{6} +} +func (m *MsgSetProviderIP) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetProviderIP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetProviderIP.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetProviderIP) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetProviderIP.Merge(m, src) +} +func (m *MsgSetProviderIP) XXX_Size() int { + return m.Size() +} +func (m *MsgSetProviderIP) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetProviderIP.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetProviderIP proto.InternalMessageInfo + +func (m *MsgSetProviderIP) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgSetProviderIP) GetIp() string { + if m != nil { + return m.Ip + } + return "" +} + +type MsgSetProviderIPResponse struct { +} + +func (m *MsgSetProviderIPResponse) Reset() { *m = MsgSetProviderIPResponse{} } +func (m *MsgSetProviderIPResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetProviderIPResponse) ProtoMessage() {} +func (*MsgSetProviderIPResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{7} +} +func (m *MsgSetProviderIPResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetProviderIPResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetProviderIPResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetProviderIPResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetProviderIPResponse.Merge(m, src) +} +func (m *MsgSetProviderIPResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetProviderIPResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetProviderIPResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetProviderIPResponse proto.InternalMessageInfo + +type MsgSetProviderTotalspace struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Space string `protobuf:"bytes,2,opt,name=space,proto3" json:"space,omitempty"` +} + +func (m *MsgSetProviderTotalspace) Reset() { *m = MsgSetProviderTotalspace{} } +func (m *MsgSetProviderTotalspace) String() string { return proto.CompactTextString(m) } +func (*MsgSetProviderTotalspace) ProtoMessage() {} +func (*MsgSetProviderTotalspace) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{8} +} +func (m *MsgSetProviderTotalspace) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetProviderTotalspace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetProviderTotalspace.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetProviderTotalspace) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetProviderTotalspace.Merge(m, src) +} +func (m *MsgSetProviderTotalspace) XXX_Size() int { + return m.Size() +} +func (m *MsgSetProviderTotalspace) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetProviderTotalspace.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetProviderTotalspace proto.InternalMessageInfo + +func (m *MsgSetProviderTotalspace) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgSetProviderTotalspace) GetSpace() string { + if m != nil { + return m.Space + } + return "" +} + +type MsgSetProviderTotalspaceResponse struct { +} + +func (m *MsgSetProviderTotalspaceResponse) Reset() { *m = MsgSetProviderTotalspaceResponse{} } +func (m *MsgSetProviderTotalspaceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetProviderTotalspaceResponse) ProtoMessage() {} +func (*MsgSetProviderTotalspaceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{9} +} +func (m *MsgSetProviderTotalspaceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetProviderTotalspaceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetProviderTotalspaceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetProviderTotalspaceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetProviderTotalspaceResponse.Merge(m, src) +} +func (m *MsgSetProviderTotalspaceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetProviderTotalspaceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetProviderTotalspaceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetProviderTotalspaceResponse proto.InternalMessageInfo + +type MsgInitProvider struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` + Totalspace string `protobuf:"bytes,3,opt,name=totalspace,proto3" json:"totalspace,omitempty"` +} + +func (m *MsgInitProvider) Reset() { *m = MsgInitProvider{} } +func (m *MsgInitProvider) String() string { return proto.CompactTextString(m) } +func (*MsgInitProvider) ProtoMessage() {} +func (*MsgInitProvider) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{10} +} +func (m *MsgInitProvider) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgInitProvider) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgInitProvider.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgInitProvider) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgInitProvider.Merge(m, src) +} +func (m *MsgInitProvider) XXX_Size() int { + return m.Size() +} +func (m *MsgInitProvider) XXX_DiscardUnknown() { + xxx_messageInfo_MsgInitProvider.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgInitProvider proto.InternalMessageInfo + +func (m *MsgInitProvider) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgInitProvider) GetIp() string { + if m != nil { + return m.Ip + } + return "" +} + +func (m *MsgInitProvider) GetTotalspace() string { + if m != nil { + return m.Totalspace + } + return "" +} + +type MsgInitProviderResponse struct { +} + +func (m *MsgInitProviderResponse) Reset() { *m = MsgInitProviderResponse{} } +func (m *MsgInitProviderResponse) String() string { return proto.CompactTextString(m) } +func (*MsgInitProviderResponse) ProtoMessage() {} +func (*MsgInitProviderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{11} +} +func (m *MsgInitProviderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgInitProviderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgInitProviderResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgInitProviderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgInitProviderResponse.Merge(m, src) +} +func (m *MsgInitProviderResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgInitProviderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgInitProviderResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgInitProviderResponse proto.InternalMessageInfo + +type MsgCancelContract struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Cid string `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid,omitempty"` +} + +func (m *MsgCancelContract) Reset() { *m = MsgCancelContract{} } +func (m *MsgCancelContract) String() string { return proto.CompactTextString(m) } +func (*MsgCancelContract) ProtoMessage() {} +func (*MsgCancelContract) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{12} +} +func (m *MsgCancelContract) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelContract.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCancelContract) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelContract.Merge(m, src) +} +func (m *MsgCancelContract) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelContract) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelContract.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelContract proto.InternalMessageInfo + +func (m *MsgCancelContract) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgCancelContract) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +type MsgCancelContractResponse struct { +} + +func (m *MsgCancelContractResponse) Reset() { *m = MsgCancelContractResponse{} } +func (m *MsgCancelContractResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCancelContractResponse) ProtoMessage() {} +func (*MsgCancelContractResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{13} +} +func (m *MsgCancelContractResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelContractResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCancelContractResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelContractResponse.Merge(m, src) +} +func (m *MsgCancelContractResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelContractResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelContractResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelContractResponse proto.InternalMessageInfo + +type MsgBuyStorage struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + ForAddress string `protobuf:"bytes,2,opt,name=forAddress,proto3" json:"forAddress,omitempty"` + Duration string `protobuf:"bytes,3,opt,name=duration,proto3" json:"duration,omitempty"` + Bytes string `protobuf:"bytes,4,opt,name=bytes,proto3" json:"bytes,omitempty"` + PaymentDenom string `protobuf:"bytes,5,opt,name=paymentDenom,proto3" json:"paymentDenom,omitempty"` +} + +func (m *MsgBuyStorage) Reset() { *m = MsgBuyStorage{} } +func (m *MsgBuyStorage) String() string { return proto.CompactTextString(m) } +func (*MsgBuyStorage) ProtoMessage() {} +func (*MsgBuyStorage) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{14} +} +func (m *MsgBuyStorage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBuyStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBuyStorage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBuyStorage) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBuyStorage.Merge(m, src) +} +func (m *MsgBuyStorage) XXX_Size() int { + return m.Size() +} +func (m *MsgBuyStorage) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBuyStorage.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBuyStorage proto.InternalMessageInfo + +func (m *MsgBuyStorage) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgBuyStorage) GetForAddress() string { + if m != nil { + return m.ForAddress + } + return "" +} + +func (m *MsgBuyStorage) GetDuration() string { + if m != nil { + return m.Duration + } + return "" +} + +func (m *MsgBuyStorage) GetBytes() string { + if m != nil { + return m.Bytes + } + return "" +} + +func (m *MsgBuyStorage) GetPaymentDenom() string { + if m != nil { + return m.PaymentDenom + } + return "" +} + +type MsgBuyStorageResponse struct { +} + +func (m *MsgBuyStorageResponse) Reset() { *m = MsgBuyStorageResponse{} } +func (m *MsgBuyStorageResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBuyStorageResponse) ProtoMessage() {} +func (*MsgBuyStorageResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{15} +} +func (m *MsgBuyStorageResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBuyStorageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBuyStorageResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBuyStorageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBuyStorageResponse.Merge(m, src) +} +func (m *MsgBuyStorageResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBuyStorageResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBuyStorageResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBuyStorageResponse proto.InternalMessageInfo + +type MsgClaimStray struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Cid string `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid,omitempty"` +} + +func (m *MsgClaimStray) Reset() { *m = MsgClaimStray{} } +func (m *MsgClaimStray) String() string { return proto.CompactTextString(m) } +func (*MsgClaimStray) ProtoMessage() {} +func (*MsgClaimStray) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{16} +} +func (m *MsgClaimStray) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimStray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClaimStray.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgClaimStray) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimStray.Merge(m, src) +} +func (m *MsgClaimStray) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimStray) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimStray.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimStray proto.InternalMessageInfo + +func (m *MsgClaimStray) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgClaimStray) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +type MsgClaimStrayResponse struct { +} + +func (m *MsgClaimStrayResponse) Reset() { *m = MsgClaimStrayResponse{} } +func (m *MsgClaimStrayResponse) String() string { return proto.CompactTextString(m) } +func (*MsgClaimStrayResponse) ProtoMessage() {} +func (*MsgClaimStrayResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab9f2215f86fb6f, []int{17} +} +func (m *MsgClaimStrayResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimStrayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClaimStrayResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgClaimStrayResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimStrayResponse.Merge(m, src) +} +func (m *MsgClaimStrayResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimStrayResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimStrayResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimStrayResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgPostContract)(nil), "jackaldao.canine.storage.MsgPostContract") + proto.RegisterType((*MsgPostContractResponse)(nil), "jackaldao.canine.storage.MsgPostContractResponse") + proto.RegisterType((*MsgPostproof)(nil), "jackaldao.canine.storage.MsgPostproof") + proto.RegisterType((*MsgPostproofResponse)(nil), "jackaldao.canine.storage.MsgPostproofResponse") + proto.RegisterType((*MsgSignContract)(nil), "jackaldao.canine.storage.MsgSignContract") + proto.RegisterType((*MsgSignContractResponse)(nil), "jackaldao.canine.storage.MsgSignContractResponse") + proto.RegisterType((*MsgSetProviderIP)(nil), "jackaldao.canine.storage.MsgSetProviderIP") + proto.RegisterType((*MsgSetProviderIPResponse)(nil), "jackaldao.canine.storage.MsgSetProviderIPResponse") + proto.RegisterType((*MsgSetProviderTotalspace)(nil), "jackaldao.canine.storage.MsgSetProviderTotalspace") + proto.RegisterType((*MsgSetProviderTotalspaceResponse)(nil), "jackaldao.canine.storage.MsgSetProviderTotalspaceResponse") + proto.RegisterType((*MsgInitProvider)(nil), "jackaldao.canine.storage.MsgInitProvider") + proto.RegisterType((*MsgInitProviderResponse)(nil), "jackaldao.canine.storage.MsgInitProviderResponse") + proto.RegisterType((*MsgCancelContract)(nil), "jackaldao.canine.storage.MsgCancelContract") + proto.RegisterType((*MsgCancelContractResponse)(nil), "jackaldao.canine.storage.MsgCancelContractResponse") + proto.RegisterType((*MsgBuyStorage)(nil), "jackaldao.canine.storage.MsgBuyStorage") + proto.RegisterType((*MsgBuyStorageResponse)(nil), "jackaldao.canine.storage.MsgBuyStorageResponse") + proto.RegisterType((*MsgClaimStray)(nil), "jackaldao.canine.storage.MsgClaimStray") + proto.RegisterType((*MsgClaimStrayResponse)(nil), "jackaldao.canine.storage.MsgClaimStrayResponse") +} + +func init() { proto.RegisterFile("canine-chain/storage/tx.proto", fileDescriptor_1ab9f2215f86fb6f) } + +var fileDescriptor_1ab9f2215f86fb6f = []byte{ + // 677 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x4e, 0xdc, 0x30, + 0x10, 0x26, 0xcb, 0x5f, 0x19, 0x2d, 0x94, 0x46, 0x50, 0x42, 0xaa, 0x46, 0x28, 0x87, 0xfe, 0x93, + 0x55, 0xe1, 0xd6, 0x1f, 0x55, 0x85, 0xaa, 0x12, 0x95, 0x56, 0x42, 0xd0, 0x53, 0x7b, 0x32, 0x89, + 0x37, 0x6b, 0x48, 0xe2, 0xc8, 0x36, 0x15, 0xdb, 0x17, 0xa8, 0x7a, 0xeb, 0x1b, 0xf4, 0x75, 0x7a, + 0xe4, 0xd8, 0x63, 0x05, 0x8f, 0xd0, 0x17, 0xa8, 0x92, 0x78, 0x1d, 0x67, 0x81, 0x6c, 0xb6, 0x37, + 0xcf, 0xf8, 0x9b, 0xef, 0x9b, 0x99, 0x78, 0x46, 0x81, 0xfb, 0x3e, 0x4a, 0x48, 0x82, 0x37, 0xfd, + 0x3e, 0x22, 0x49, 0x87, 0x0b, 0xca, 0x50, 0x88, 0x3b, 0xe2, 0xcc, 0x4b, 0x19, 0x15, 0xd4, 0xb4, + 0x8e, 0x91, 0x7f, 0x82, 0xa2, 0x00, 0x51, 0xaf, 0x00, 0x7a, 0x12, 0xe2, 0x7e, 0x37, 0xe0, 0x76, + 0x97, 0x87, 0xfb, 0x94, 0x8b, 0x5d, 0x9a, 0x08, 0x86, 0x7c, 0x61, 0x5a, 0x30, 0xef, 0x33, 0x8c, + 0x04, 0x65, 0x96, 0xb1, 0x61, 0x3c, 0x5a, 0x38, 0x18, 0x9a, 0xe6, 0x5d, 0x98, 0x8b, 0x31, 0x3b, + 0x89, 0xb0, 0xd5, 0xca, 0x2f, 0xa4, 0x95, 0xf9, 0x39, 0x09, 0x13, 0x8c, 0xad, 0xe9, 0xc2, 0x5f, + 0x58, 0xa6, 0x0d, 0xb7, 0x7a, 0x24, 0xc2, 0x9c, 0x7c, 0xc5, 0xd6, 0x4c, 0x7e, 0xa3, 0x6c, 0x73, + 0x19, 0xa6, 0x7b, 0x24, 0xb0, 0x66, 0x73, 0x77, 0x76, 0x74, 0xd7, 0x61, 0x6d, 0x24, 0x95, 0x03, + 0xcc, 0x53, 0x9a, 0x70, 0xec, 0x1e, 0x43, 0x5b, 0x5e, 0xa5, 0x8c, 0xd2, 0x5e, 0x4d, 0x8a, 0x26, + 0xcc, 0x10, 0x81, 0x63, 0x99, 0x60, 0x7e, 0xce, 0xd2, 0xe8, 0x23, 0xde, 0x8f, 0x08, 0x17, 0x32, + 0x41, 0x65, 0x67, 0x69, 0xf8, 0x24, 0x90, 0xd9, 0x65, 0x47, 0xd7, 0x83, 0x15, 0x5d, 0x6b, 0x98, + 0x83, 0x56, 0xbc, 0xa1, 0x17, 0xef, 0xbe, 0xce, 0x3b, 0x78, 0x48, 0xc2, 0xa4, 0x41, 0x07, 0xa5, + 0x5c, 0xab, 0x94, 0x2b, 0xaa, 0xd6, 0xc3, 0x55, 0xd5, 0xaf, 0x60, 0x39, 0xbb, 0xc2, 0x62, 0x9f, + 0xd1, 0x2f, 0x24, 0xc0, 0x6c, 0x6f, 0xbf, 0x86, 0x7a, 0x09, 0x5a, 0x24, 0x95, 0xcc, 0x2d, 0x92, + 0xba, 0x36, 0x58, 0xa3, 0xd1, 0x8a, 0xf9, 0xc3, 0xe8, 0xdd, 0x47, 0x2a, 0x50, 0xc4, 0x53, 0xe4, + 0xe3, 0x1a, 0x85, 0x15, 0x98, 0xcd, 0x21, 0x52, 0xa4, 0x30, 0x5c, 0x17, 0x36, 0x6e, 0xe2, 0x52, + 0x7a, 0x9f, 0xf3, 0x1e, 0xed, 0x25, 0x44, 0x81, 0x9a, 0x17, 0x62, 0x3a, 0x00, 0x42, 0x51, 0xca, + 0x0f, 0xa8, 0x79, 0x64, 0x07, 0x75, 0x72, 0xa5, 0xfb, 0x06, 0xee, 0x74, 0x79, 0xb8, 0x8b, 0x12, + 0x1f, 0x47, 0xff, 0xf5, 0x75, 0xee, 0xc1, 0xfa, 0x15, 0x02, 0xc5, 0xfe, 0xd3, 0x80, 0xc5, 0x2e, + 0x0f, 0x77, 0x4e, 0x07, 0x87, 0xc5, 0x38, 0xd5, 0x50, 0x3b, 0x00, 0x3d, 0xca, 0xde, 0x06, 0x01, + 0xc3, 0x9c, 0x4b, 0x05, 0xcd, 0x93, 0xbd, 0xd1, 0xe0, 0x94, 0x21, 0x41, 0x68, 0x32, 0x7c, 0xa3, + 0x43, 0x3b, 0xeb, 0xfb, 0xd1, 0x40, 0x60, 0x2e, 0x5f, 0x69, 0x61, 0x98, 0x2e, 0xb4, 0x53, 0x34, + 0x88, 0x71, 0x22, 0xde, 0xe1, 0x84, 0xc6, 0x72, 0x92, 0x2a, 0x3e, 0x77, 0x0d, 0x56, 0x2b, 0x09, + 0xaa, 0xd4, 0x5f, 0xe6, 0x99, 0xef, 0x46, 0x88, 0xc4, 0x87, 0x82, 0xa1, 0xc1, 0x44, 0x4d, 0x29, + 0x58, 0xcb, 0xe0, 0x21, 0xeb, 0xd6, 0xdf, 0x79, 0x98, 0xee, 0xf2, 0xd0, 0x8c, 0xa0, 0x5d, 0xd9, + 0x28, 0x8f, 0xbd, 0x9b, 0x16, 0x90, 0x37, 0x32, 0xf1, 0xf6, 0xf3, 0xc6, 0x50, 0x35, 0x98, 0x3e, + 0x2c, 0x94, 0x9b, 0xe1, 0xc1, 0xd8, 0xf8, 0x1c, 0x67, 0x7b, 0xcd, 0x70, 0x4a, 0x24, 0x82, 0x76, + 0x65, 0xc4, 0xeb, 0x4b, 0xd2, 0xa1, 0x63, 0x4a, 0xba, 0x6e, 0xf2, 0x4d, 0x0a, 0x8b, 0xd5, 0xb1, + 0x7f, 0x52, 0xcf, 0xa1, 0x63, 0xed, 0xad, 0xe6, 0x58, 0x25, 0xf8, 0xcd, 0x80, 0xd5, 0xeb, 0xd7, + 0x41, 0x63, 0xb6, 0x32, 0xc6, 0x7e, 0x31, 0x79, 0x8c, 0xde, 0xe8, 0xca, 0x9e, 0xa8, 0x6f, 0xb4, + 0x0e, 0x1d, 0xd3, 0xe8, 0xeb, 0x16, 0x84, 0xc9, 0x60, 0x69, 0x64, 0x3b, 0x3c, 0xad, 0x25, 0xa9, + 0x82, 0xed, 0xed, 0x09, 0xc0, 0x4a, 0xb3, 0x07, 0xa0, 0xad, 0x8c, 0x87, 0xb5, 0x14, 0x25, 0xd0, + 0xee, 0x34, 0x04, 0xea, 0x3a, 0xda, 0x80, 0xd7, 0xeb, 0x94, 0xc0, 0x31, 0x3a, 0x57, 0xa7, 0x7e, + 0xe7, 0xfd, 0xaf, 0x0b, 0xc7, 0x38, 0xbf, 0x70, 0x8c, 0x3f, 0x17, 0x8e, 0xf1, 0xe3, 0xd2, 0x99, + 0x3a, 0xbf, 0x74, 0xa6, 0x7e, 0x5f, 0x3a, 0x53, 0x9f, 0x9e, 0x85, 0x44, 0xf4, 0x4f, 0x8f, 0x3c, + 0x9f, 0xc6, 0x9d, 0x82, 0x74, 0x33, 0x40, 0xb4, 0x53, 0xb0, 0x76, 0xce, 0xca, 0x1f, 0x95, 0x41, + 0x8a, 0xf9, 0xd1, 0x5c, 0xfe, 0xb3, 0xb2, 0xfd, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xde, 0x91, 0x74, + 0xe8, 0xcd, 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 { + PostContract(ctx context.Context, in *MsgPostContract, opts ...grpc.CallOption) (*MsgPostContractResponse, error) + Postproof(ctx context.Context, in *MsgPostproof, opts ...grpc.CallOption) (*MsgPostproofResponse, error) + SignContract(ctx context.Context, in *MsgSignContract, opts ...grpc.CallOption) (*MsgSignContractResponse, error) + SetProviderIP(ctx context.Context, in *MsgSetProviderIP, opts ...grpc.CallOption) (*MsgSetProviderIPResponse, error) + SetProviderTotalspace(ctx context.Context, in *MsgSetProviderTotalspace, opts ...grpc.CallOption) (*MsgSetProviderTotalspaceResponse, error) + InitProvider(ctx context.Context, in *MsgInitProvider, opts ...grpc.CallOption) (*MsgInitProviderResponse, error) + CancelContract(ctx context.Context, in *MsgCancelContract, opts ...grpc.CallOption) (*MsgCancelContractResponse, error) + BuyStorage(ctx context.Context, in *MsgBuyStorage, opts ...grpc.CallOption) (*MsgBuyStorageResponse, error) + ClaimStray(ctx context.Context, in *MsgClaimStray, opts ...grpc.CallOption) (*MsgClaimStrayResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) PostContract(ctx context.Context, in *MsgPostContract, opts ...grpc.CallOption) (*MsgPostContractResponse, error) { + out := new(MsgPostContractResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Msg/PostContract", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Postproof(ctx context.Context, in *MsgPostproof, opts ...grpc.CallOption) (*MsgPostproofResponse, error) { + out := new(MsgPostproofResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Msg/Postproof", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SignContract(ctx context.Context, in *MsgSignContract, opts ...grpc.CallOption) (*MsgSignContractResponse, error) { + out := new(MsgSignContractResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Msg/SignContract", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SetProviderIP(ctx context.Context, in *MsgSetProviderIP, opts ...grpc.CallOption) (*MsgSetProviderIPResponse, error) { + out := new(MsgSetProviderIPResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Msg/SetProviderIP", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SetProviderTotalspace(ctx context.Context, in *MsgSetProviderTotalspace, opts ...grpc.CallOption) (*MsgSetProviderTotalspaceResponse, error) { + out := new(MsgSetProviderTotalspaceResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Msg/SetProviderTotalspace", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) InitProvider(ctx context.Context, in *MsgInitProvider, opts ...grpc.CallOption) (*MsgInitProviderResponse, error) { + out := new(MsgInitProviderResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Msg/InitProvider", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CancelContract(ctx context.Context, in *MsgCancelContract, opts ...grpc.CallOption) (*MsgCancelContractResponse, error) { + out := new(MsgCancelContractResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Msg/CancelContract", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) BuyStorage(ctx context.Context, in *MsgBuyStorage, opts ...grpc.CallOption) (*MsgBuyStorageResponse, error) { + out := new(MsgBuyStorageResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Msg/BuyStorage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ClaimStray(ctx context.Context, in *MsgClaimStray, opts ...grpc.CallOption) (*MsgClaimStrayResponse, error) { + out := new(MsgClaimStrayResponse) + err := c.cc.Invoke(ctx, "/jackaldao.canine.storage.Msg/ClaimStray", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + PostContract(context.Context, *MsgPostContract) (*MsgPostContractResponse, error) + Postproof(context.Context, *MsgPostproof) (*MsgPostproofResponse, error) + SignContract(context.Context, *MsgSignContract) (*MsgSignContractResponse, error) + SetProviderIP(context.Context, *MsgSetProviderIP) (*MsgSetProviderIPResponse, error) + SetProviderTotalspace(context.Context, *MsgSetProviderTotalspace) (*MsgSetProviderTotalspaceResponse, error) + InitProvider(context.Context, *MsgInitProvider) (*MsgInitProviderResponse, error) + CancelContract(context.Context, *MsgCancelContract) (*MsgCancelContractResponse, error) + BuyStorage(context.Context, *MsgBuyStorage) (*MsgBuyStorageResponse, error) + ClaimStray(context.Context, *MsgClaimStray) (*MsgClaimStrayResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) PostContract(ctx context.Context, req *MsgPostContract) (*MsgPostContractResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PostContract not implemented") +} +func (*UnimplementedMsgServer) Postproof(ctx context.Context, req *MsgPostproof) (*MsgPostproofResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Postproof not implemented") +} +func (*UnimplementedMsgServer) SignContract(ctx context.Context, req *MsgSignContract) (*MsgSignContractResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SignContract not implemented") +} +func (*UnimplementedMsgServer) SetProviderIP(ctx context.Context, req *MsgSetProviderIP) (*MsgSetProviderIPResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetProviderIP not implemented") +} +func (*UnimplementedMsgServer) SetProviderTotalspace(ctx context.Context, req *MsgSetProviderTotalspace) (*MsgSetProviderTotalspaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetProviderTotalspace not implemented") +} +func (*UnimplementedMsgServer) InitProvider(ctx context.Context, req *MsgInitProvider) (*MsgInitProviderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitProvider not implemented") +} +func (*UnimplementedMsgServer) CancelContract(ctx context.Context, req *MsgCancelContract) (*MsgCancelContractResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelContract not implemented") +} +func (*UnimplementedMsgServer) BuyStorage(ctx context.Context, req *MsgBuyStorage) (*MsgBuyStorageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BuyStorage not implemented") +} +func (*UnimplementedMsgServer) ClaimStray(ctx context.Context, req *MsgClaimStray) (*MsgClaimStrayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClaimStray not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_PostContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPostContract) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).PostContract(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Msg/PostContract", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).PostContract(ctx, req.(*MsgPostContract)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Postproof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPostproof) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Postproof(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Msg/Postproof", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Postproof(ctx, req.(*MsgPostproof)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SignContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSignContract) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SignContract(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Msg/SignContract", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SignContract(ctx, req.(*MsgSignContract)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SetProviderIP_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetProviderIP) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetProviderIP(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Msg/SetProviderIP", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetProviderIP(ctx, req.(*MsgSetProviderIP)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SetProviderTotalspace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetProviderTotalspace) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetProviderTotalspace(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Msg/SetProviderTotalspace", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetProviderTotalspace(ctx, req.(*MsgSetProviderTotalspace)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_InitProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgInitProvider) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).InitProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Msg/InitProvider", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).InitProvider(ctx, req.(*MsgInitProvider)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CancelContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCancelContract) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CancelContract(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Msg/CancelContract", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CancelContract(ctx, req.(*MsgCancelContract)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_BuyStorage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBuyStorage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).BuyStorage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Msg/BuyStorage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).BuyStorage(ctx, req.(*MsgBuyStorage)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ClaimStray_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClaimStray) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ClaimStray(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackaldao.canine.storage.Msg/ClaimStray", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ClaimStray(ctx, req.(*MsgClaimStray)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "jackaldao.canine.storage.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "PostContract", + Handler: _Msg_PostContract_Handler, + }, + { + MethodName: "Postproof", + Handler: _Msg_Postproof_Handler, + }, + { + MethodName: "SignContract", + Handler: _Msg_SignContract_Handler, + }, + { + MethodName: "SetProviderIP", + Handler: _Msg_SetProviderIP_Handler, + }, + { + MethodName: "SetProviderTotalspace", + Handler: _Msg_SetProviderTotalspace_Handler, + }, + { + MethodName: "InitProvider", + Handler: _Msg_InitProvider_Handler, + }, + { + MethodName: "CancelContract", + Handler: _Msg_CancelContract_Handler, + }, + { + MethodName: "BuyStorage", + Handler: _Msg_BuyStorage_Handler, + }, + { + MethodName: "ClaimStray", + Handler: _Msg_ClaimStray_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "canine-chain/storage/tx.proto", +} + +func (m *MsgPostContract) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPostContract) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPostContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Fid) > 0 { + i -= len(m.Fid) + copy(dAtA[i:], m.Fid) + i = encodeVarintTx(dAtA, i, uint64(len(m.Fid))) + i-- + dAtA[i] = 0x2a + } + if len(m.Filesize) > 0 { + i -= len(m.Filesize) + copy(dAtA[i:], m.Filesize) + i = encodeVarintTx(dAtA, i, uint64(len(m.Filesize))) + i-- + dAtA[i] = 0x22 + } + if len(m.Signee) > 0 { + i -= len(m.Signee) + copy(dAtA[i:], m.Signee) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signee))) + i-- + dAtA[i] = 0x1a + } + if len(m.Merkle) > 0 { + i -= len(m.Merkle) + copy(dAtA[i:], m.Merkle) + i = encodeVarintTx(dAtA, i, uint64(len(m.Merkle))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgPostContractResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPostContractResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPostContractResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgPostproof) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPostproof) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPostproof) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintTx(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0x22 + } + if len(m.Hashlist) > 0 { + i -= len(m.Hashlist) + copy(dAtA[i:], m.Hashlist) + i = encodeVarintTx(dAtA, i, uint64(len(m.Hashlist))) + i-- + dAtA[i] = 0x1a + } + if len(m.Item) > 0 { + i -= len(m.Item) + copy(dAtA[i:], m.Item) + i = encodeVarintTx(dAtA, i, uint64(len(m.Item))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgPostproofResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPostproofResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPostproofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Merkle) > 0 { + i -= len(m.Merkle) + copy(dAtA[i:], m.Merkle) + i = encodeVarintTx(dAtA, i, uint64(len(m.Merkle))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSignContract) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSignContract) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSignContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintTx(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSignContractResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSignContractResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSignContractResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgSetProviderIP) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetProviderIP) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetProviderIP) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Ip) > 0 { + i -= len(m.Ip) + copy(dAtA[i:], m.Ip) + i = encodeVarintTx(dAtA, i, uint64(len(m.Ip))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetProviderIPResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetProviderIPResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetProviderIPResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgSetProviderTotalspace) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetProviderTotalspace) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetProviderTotalspace) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Space) > 0 { + i -= len(m.Space) + copy(dAtA[i:], m.Space) + i = encodeVarintTx(dAtA, i, uint64(len(m.Space))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetProviderTotalspaceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetProviderTotalspaceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetProviderTotalspaceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgInitProvider) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgInitProvider) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgInitProvider) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Totalspace) > 0 { + i -= len(m.Totalspace) + copy(dAtA[i:], m.Totalspace) + i = encodeVarintTx(dAtA, i, uint64(len(m.Totalspace))) + i-- + dAtA[i] = 0x1a + } + if len(m.Ip) > 0 { + i -= len(m.Ip) + copy(dAtA[i:], m.Ip) + i = encodeVarintTx(dAtA, i, uint64(len(m.Ip))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgInitProviderResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgInitProviderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgInitProviderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCancelContract) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCancelContract) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintTx(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCancelContractResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCancelContractResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelContractResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgBuyStorage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBuyStorage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBuyStorage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PaymentDenom) > 0 { + i -= len(m.PaymentDenom) + copy(dAtA[i:], m.PaymentDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.PaymentDenom))) + i-- + dAtA[i] = 0x2a + } + if len(m.Bytes) > 0 { + i -= len(m.Bytes) + copy(dAtA[i:], m.Bytes) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bytes))) + i-- + dAtA[i] = 0x22 + } + if len(m.Duration) > 0 { + i -= len(m.Duration) + copy(dAtA[i:], m.Duration) + i = encodeVarintTx(dAtA, i, uint64(len(m.Duration))) + i-- + dAtA[i] = 0x1a + } + if len(m.ForAddress) > 0 { + i -= len(m.ForAddress) + copy(dAtA[i:], m.ForAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.ForAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgBuyStorageResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBuyStorageResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBuyStorageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgClaimStray) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgClaimStray) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimStray) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintTx(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgClaimStrayResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgClaimStrayResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimStrayResponse) 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 *MsgPostContract) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Merkle) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signee) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Filesize) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Fid) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgPostContractResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgPostproof) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Item) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Hashlist) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgPostproofResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Merkle) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSignContract) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSignContractResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSetProviderIP) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Ip) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetProviderIPResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSetProviderTotalspace) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Space) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetProviderTotalspaceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgInitProvider) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Ip) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Totalspace) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgInitProviderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCancelContract) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCancelContractResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgBuyStorage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ForAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Duration) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Bytes) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.PaymentDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgBuyStorageResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgClaimStray) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgClaimStrayResponse) 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 *MsgPostContract) Unmarshal(dAtA []byte) 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: MsgPostContract: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPostContract: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Merkle", 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.Merkle = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signee", 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.Signee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filesize", 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.Filesize = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fid", 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.Fid = 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 *MsgPostContractResponse) Unmarshal(dAtA []byte) 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: MsgPostContractResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPostContractResponse: 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 *MsgPostproof) Unmarshal(dAtA []byte) 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: MsgPostproof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPostproof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Item", 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.Item = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hashlist", 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.Hashlist = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", 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.Cid = 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 *MsgPostproofResponse) Unmarshal(dAtA []byte) 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: MsgPostproofResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPostproofResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Merkle", 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.Merkle = 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 *MsgSignContract) Unmarshal(dAtA []byte) 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: MsgSignContract: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSignContract: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", 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.Cid = 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 *MsgSignContractResponse) Unmarshal(dAtA []byte) 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: MsgSignContractResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSignContractResponse: 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 *MsgSetProviderIP) Unmarshal(dAtA []byte) 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: MsgSetProviderIP: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetProviderIP: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ip", 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.Ip = 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 *MsgSetProviderIPResponse) Unmarshal(dAtA []byte) 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: MsgSetProviderIPResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetProviderIPResponse: 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 *MsgSetProviderTotalspace) Unmarshal(dAtA []byte) 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: MsgSetProviderTotalspace: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetProviderTotalspace: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Space", 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.Space = 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 *MsgSetProviderTotalspaceResponse) Unmarshal(dAtA []byte) 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: MsgSetProviderTotalspaceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetProviderTotalspaceResponse: 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 *MsgInitProvider) Unmarshal(dAtA []byte) 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: MsgInitProvider: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgInitProvider: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ip", 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.Ip = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Totalspace", 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.Totalspace = 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 *MsgInitProviderResponse) Unmarshal(dAtA []byte) 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: MsgInitProviderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgInitProviderResponse: 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 *MsgCancelContract) Unmarshal(dAtA []byte) 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: MsgCancelContract: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelContract: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", 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.Cid = 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 *MsgCancelContractResponse) Unmarshal(dAtA []byte) 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: MsgCancelContractResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelContractResponse: 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 *MsgBuyStorage) Unmarshal(dAtA []byte) 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: MsgBuyStorage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBuyStorage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ForAddress", 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.ForAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", 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.Duration = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bytes", 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.Bytes = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PaymentDenom", 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.PaymentDenom = 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 *MsgBuyStorageResponse) Unmarshal(dAtA []byte) 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: MsgBuyStorageResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBuyStorageResponse: 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 *MsgClaimStray) Unmarshal(dAtA []byte) 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: MsgClaimStray: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimStray: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", 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.Cid = 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 *MsgClaimStrayResponse) Unmarshal(dAtA []byte) 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: MsgClaimStrayResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimStrayResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/storage/types/types.go b/x/storage/types/types.go new file mode 100644 index 000000000..87ead38a7 --- /dev/null +++ b/x/storage/types/types.go @@ -0,0 +1,7 @@ +package types + +const ( + addressPrefix = "jkl" + cidPrefix = "jklc" + fidPrefix = "jklf" +)