diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8eb92d4..1b1e0876 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: ci on: push: branches: # only for pushes on master - - master + - master pull_request: # for all PRs regardless of its base branch jobs: @@ -12,29 +12,43 @@ jobs: name: Build and Test runs-on: ubuntu-latest steps: + - name: Set up Go 1.x + uses: actions/setup-go@v3 + with: + go-version: 1.19 + id: go - - name: Set up Go 1.x - uses: actions/setup-go@v3 - with: - go-version: 1.19 - id: go + - name: Check out code into the Go module directory + uses: actions/checkout@v3 - - name: Check out code into the Go module directory - uses: actions/checkout@v3 + - name: Build (+ generating proto and docs) + run: make build-all - - name: Build (+ generating proto and docs) - run: make build-all + - name: Test + run: make test - - name: Test - run: make test + - name: Publish coverage.html as an artifact + uses: actions/upload-artifact@master + with: + name: coverage + path: artifacts/coverage.html - - name: Lint - uses: golangci/golangci-lint-action@v3 - with: - version: latest + lint: + name: Lint + runs-on: ubuntu-latest - - name: Publish coverage.html as an artifact - uses: actions/upload-artifact@master - with: - name: coverage - path: artifacts/coverage.html + steps: + - name: Set up Go 1.x + uses: actions/setup-go@v3 + with: + go-version: 1.19 + id: go + + - name: Checkout code into the Go module directory + uses: actions/checkout@v3 + + - name: Lint + uses: golangci/golangci-lint-action@v3 + with: + version: latest + args: --timeout=5m diff --git a/go.mod b/go.mod index e81d59c4..6fafc553 100644 --- a/go.mod +++ b/go.mod @@ -25,6 +25,7 @@ require ( golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b google.golang.org/grpc v1.48.0 + google.golang.org/protobuf v1.28.0 ) require ( @@ -121,7 +122,6 @@ require ( golang.org/x/sys v0.0.0-20220727055044-e65921a090b8 // indirect golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect golang.org/x/text v0.3.7 // indirect - google.golang.org/protobuf v1.28.0 // indirect gopkg.in/ini.v1 v1.66.6 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index d705db37..3176b14d 100644 --- a/go.sum +++ b/go.sum @@ -146,6 +146,7 @@ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbt github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -231,6 +232,7 @@ github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSa github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.1.13/go.mod h1:L5Z7tw+7lRK1Fnpi/LT/ooCP1elkXn0krMWBQHUhEDE= +github.com/adlio/schema v1.2.3/go.mod h1:nD7ZWmMMbwU12Pqwg+qL0rTvHBrBXfNz+5UQxTfy38M= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= @@ -332,6 +334,7 @@ github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BR github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= +github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= @@ -464,6 +467,7 @@ github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cE github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= +github.com/containerd/continuity v0.2.1/go.mod h1:wCYX+dRqZdImhGucXOqTQn05AhX6EUDaGEMUzTFFpLg= github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= github.com/containerd/continuity v0.2.3-0.20220330195504-d132b287edc8/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -559,6 +563,7 @@ 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/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= +github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= github.com/cosmos/iavl v0.19.3 h1:cESO0OwTTxQm5rmyESKW+zESheDUYI7CcZDWWDwnuxg= github.com/cosmos/iavl v0.19.3/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= github.com/cosmos/ibc-go/v2 v2.0.3 h1:kZ6SAj7hyxoixsLEUBx431bVGiBW22PCHwkWHafWhXs= @@ -685,10 +690,12 @@ github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQL github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= @@ -1552,6 +1559,7 @@ github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rm github.com/opencontainers/runc v1.0.0-rc92/go.mod h1:X1zlU4p7wOlX4+WRCz+hvlRv8phdL7UqbYD+vQwNMmE= github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= +github.com/opencontainers/runc v1.0.3/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= github.com/opencontainers/runc v1.1.1/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= github.com/opencontainers/runc v1.1.2/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= @@ -1748,6 +1756,7 @@ github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.26.0/go.mod h1:yBiM87lvSqX8h0Ww4sdzNSkVYZ8dL2xjZJG1lAuGZEo= github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= @@ -1763,6 +1772,7 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= +github.com/sagikazarmark/crypt v0.4.0/go.mod h1:ALv2SRj7GxYV4HO9elxH9nS6M9gW+xDNxqmyJ6RfDFM= github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= @@ -1865,6 +1875,7 @@ github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5q github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= +github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= @@ -1924,6 +1935,7 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM 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.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= +github.com/tendermint/tendermint v0.34.16/go.mod h1:n0G22GynfeXTYbrn2IeLeB+oqsAe6R6jl4vZxZ1Y8F4= github.com/tendermint/tendermint v0.34.20/go.mod h1:KtOwCLYJcsS1ymtAfnjjAtXfXClbqcqjdqzFt2Em1Ac= github.com/tendermint/tendermint v0.34.21 h1:UiGGnBFHVrZhoQVQ7EfwSOLuCtarqCSsRf8VrklqB7s= github.com/tendermint/tendermint v0.34.21/go.mod h1:XDvfg6U7grcFTDx7VkzxnhazQ/bspGJAn4DZ6DcLLjQ= @@ -2332,6 +2344,7 @@ golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -2828,6 +2841,7 @@ google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= diff --git a/proto/panacea/datadeal/v2/certificate.proto b/proto/panacea/datadeal/v2/certificate.proto new file mode 100644 index 00000000..22650913 --- /dev/null +++ b/proto/panacea/datadeal/v2/certificate.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package panacea.datadeal.v2; + +option go_package = "github.com/medibloc/panacea-core/x/datadeal/types"; + +import "gogoproto/gogo.proto"; +import "panacea/datadeal/v2/deal.proto"; + +// Certificate defines a certificate with signature +message Certificate { + UnsignedCertificate unsigned_certificate = 1; + bytes signature = 2; +} + +// UnsignedCertificate defines a certificate information +message UnsignedCertificate { + string cid = 1; + string oracle_address = 2; + int64 deal_id = 3; + string provider_address = 4; + string data_hash = 5; +} \ No newline at end of file diff --git a/proto/panacea/datadeal/v2/deal.proto b/proto/panacea/datadeal/v2/deal.proto new file mode 100644 index 00000000..57e67131 --- /dev/null +++ b/proto/panacea/datadeal/v2/deal.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package panacea.datadeal.v2; + +option go_package = "github.com/medibloc/panacea-core/x/datadeal/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// Deal defines a deal. +message Deal { + uint64 id = 1; + string address = 2; + repeated string data_schema = 3; + cosmos.base.v1beta1.Coin budget = 4; + uint64 max_num_data = 5; + uint64 cur_num_data = 6; + string consumer_address = 7; + DealStatus status = 8; +} + +// DealStatus enumerates the status of deal. +enum DealStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // DEAL_STATUS_UNSPECIFIED + DEAL_STATUS_UNSPECIFIED = 0; + + // DEAL_STATUS_ACTIVE defines the deal status that is active. + DEAL_STATUS_ACTIVE = 1; + + // DEAL_STATUS_INACTIVE defines the deal status that is inactive. + DEAL_STATUS_INACTIVE = 2; + + // DEAL_STATUS_COMPLETED defines the deal status that is completed. + DEAL_STATUS_COMPLETED = 3; +} \ No newline at end of file diff --git a/proto/panacea/datadeal/v2/genesis.proto b/proto/panacea/datadeal/v2/genesis.proto new file mode 100644 index 00000000..39f4b844 --- /dev/null +++ b/proto/panacea/datadeal/v2/genesis.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package panacea.datadeal.v2; + +option go_package = "github.com/medibloc/panacea-core/x/datadeal/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "panacea/datadeal/v2/deal.proto"; +import "panacea/datadeal/v2/certificate.proto"; + +// GenesisState defines the datadeal module's genesis state. +message GenesisState { + uint64 next_deal_number = 1; + repeated Deal deals = 2 [(gogoproto.nullable) = false]; + repeated Certificate certificates = 3 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/proto/panacea/datadeal/v2/query.proto b/proto/panacea/datadeal/v2/query.proto new file mode 100644 index 00000000..1776eef1 --- /dev/null +++ b/proto/panacea/datadeal/v2/query.proto @@ -0,0 +1,80 @@ +syntax = "proto3"; +package panacea.datadeal.v2; + +option go_package = "github.com/medibloc/panacea-core/x/datadeal/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "panacea/datadeal/v2/deal.proto"; +import "panacea/datadeal/v2/certificate.proto"; + +// Query defines the gRPC querier service. +service Query { + // Deals return a list of Deal. + rpc Deals(QueryDealsRequest) returns (QueryDealsResponse) { + option (google.api.http).get = "/panacea/datadeal/v2/deals"; + } + + // Deal returns a Deal. + rpc Deal(QueryDealRequest) returns (QueryDealResponse) { + option (google.api.http).get = "/panacea/datadeal/v2/deals/{deal_id}"; + } + + // Certificates returns a list of Certificate. + rpc Certificates(QueryCertificates) returns (QueryCertificatesResponse) { + option (google.api.http).get = "/panacea/datadeal/v2/deals/{deal_id}/certificates"; + } + + // Certificate returns a Certificate + rpc Certificate(QueryCertificate) returns (QueryCertificateResponse) { + option (google.api.http).get = "/panacea/datadeal/v2/deals/{deal_id}/certificates/{data_hash}"; + } + + +} + +// QueryDealsRequest defines the request type for the Query/Deals RPC method. +message QueryDealsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryDealsResponse defines the response type for the Query/Deals RPC method. +message QueryDealsResponse { + repeated Deal deal = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDealRequest defines the request type for the Query/Deal RPC method. +message QueryDealRequest { + uint64 deal_id = 1; +} + +// QueryDealResponse defines the response type for the Query/Deal RPC method. +message QueryDealResponse { + Deal deal = 1; +} + +// QueryDealsRequest defines the request type for the Query/Deals RPC method. +message QueryCertificates { + int64 deal_id = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDealsResponse defines the response type for the Query/Deals RPC method. +message QueryCertificatesResponse { + repeated Certificate certificates = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryCertificate defines the request type for the Query/Certificate RPC method. +message QueryCertificate { + uint64 deal_id = 1; + string data_hash = 2; +} + +// QueryCertificateResponse defines the response type for the Query/Certificate RPC method. +message QueryCertificateResponse { + Certificate certificate = 1; +} + diff --git a/proto/panacea/datadeal/v2/tx.proto b/proto/panacea/datadeal/v2/tx.proto new file mode 100644 index 00000000..ca627eff --- /dev/null +++ b/proto/panacea/datadeal/v2/tx.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package panacea.datadeal.v2; + +option go_package = "github.com/medibloc/panacea-core/x/datadeal/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "panacea/datadeal/v2/deal.proto"; +import "panacea/datadeal/v2/certificate.proto"; + +// Msg defines the Msg service. +service Msg { + // CreateDeal defines a method for creating a deal. + rpc CreateDeal(MsgCreateDeal) returns (MsgCreateDealResponse); + + // DeactivateDeal defines a method for deactivating the deal. + rpc DeactivateDeal(MsgDeactivateDeal) returns (MsgDeactivateDealResponse); + + // SubmitConsent defines a method for provider's submit consent + rpc SubmitConsent(MsgSubmitConsent) returns (MsgSubmitConsentResponse); +} + +// MsgCreateDeal defines the Msg/CreateDeal request type. +message MsgCreateDeal { + repeated string data_schema = 1; + cosmos.base.v1beta1.Coin budget = 2; + uint64 max_num_data = 3; + string buyer_address = 4; +} + +// MsgCreateDealResponse defines the Msg/CreateDeal response type. +message MsgCreateDealResponse { + uint64 deal_id = 1; +} + +// MsgDeactivateDeal defines the Msg/DeactivateDeal request type. +message MsgDeactivateDeal { + uint64 deal_id = 1; + string requester_address = 2; +} + +// MsgDeactivateDealResponse defines the Msg/DeactivateDeal response type. +message MsgDeactivateDealResponse { +} + +// MsgSubmitConsent defines the Msg/SubmitConsent request type. +message MsgSubmitConsent { + Certificate certificate = 1; +} + +// MsgSubmitConsentResponse defines the Msg/SubmitConsent response type. +message MsgSubmitConsentResponse { +} \ No newline at end of file diff --git a/proto/panacea/oracle/v2/genesis.proto b/proto/panacea/oracle/v2/genesis.proto new file mode 100644 index 00000000..25f5b2b3 --- /dev/null +++ b/proto/panacea/oracle/v2/genesis.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package panacea.oracle.v2; + +option go_package = "github.com/medibloc/panacea-core/x/oracle/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "panacea/oracle/v2/oracle.proto"; + +// GenesisState defines the oracle module's genesis state. +message GenesisState { + repeated Oracle oracles = 1 [(gogoproto.nullable) = false]; + repeated OracleRegistration oracle_registrations = 2 [(gogoproto.nullable) = false]; +} + +// Params defines the oracle module's params. +message Params { + // A base64-encoded oracle public key which is paired with an oracle private key generated in SGX by the first oracle. + // This key is used to encrypt data, so that the data can be decrypted and verified securely only in SGX + string oracle_public_key = 1; + // A base64-encoded SGX remote report which contains an oracle public key. + // Using this report, anyone can validate that the oracle key pair was generated in SGX. + string oracle_pub_key_remote_report = 2; + // The unique ID of current version of oracle. + string unique_id = 3; +} \ No newline at end of file diff --git a/proto/panacea/oracle/v2/oracle.proto b/proto/panacea/oracle/v2/oracle.proto new file mode 100644 index 00000000..7484569c --- /dev/null +++ b/proto/panacea/oracle/v2/oracle.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package panacea.oracle.v2; + +option go_package = "github.com/medibloc/panacea-core/x/oracle/types"; + +import "gogoproto/gogo.proto"; + +// Oracle defines a detail of oracle. +message Oracle { + string oracle_address = 1; + string unique_id = 2; + string endpoint = 3; + string oracle_commission_rate = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +// OracleRegistration defines the detailed states of the registration of oracle. +message OracleRegistration { + string unique_id = 1; + string oracle_address = 2; + // Node public key is a pair with a node private key which is generated in SGX by each oracle. + // This key is used to share the oracle private key from other oracles. + bytes node_pub_key = 3; + // Anyone can validate that the node key pair is generated in SGX using this node key remote report. + bytes node_pub_key_remote_report = 4; + // The trusted block info is required for light client. + // Other oracle can validate whether the oracle set correct trusted block info. + int64 trusted_block_height = 5; + bytes trusted_block_hash = 6; + string endpoint = 7; + string oracle_commission_rate = 8 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/proto/panacea/oracle/v2/query.proto b/proto/panacea/oracle/v2/query.proto new file mode 100644 index 00000000..278af92a --- /dev/null +++ b/proto/panacea/oracle/v2/query.proto @@ -0,0 +1,90 @@ +syntax = "proto3"; +package panacea.oracle.v2; + +option go_package = "github.com/medibloc/panacea-core/x/oracle/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "panacea/oracle/v2/oracle.proto"; +import "panacea/oracle/v2/genesis.proto"; + +// Query defines the gRPC querier service. +service Query { + // Oracles returns a list of oracles. + rpc Oracles(QueryOraclesRequest) returns (QueryOraclesResponse) { + option (google.api.http).get = "/panacea/oracle/v2/oracles"; + } + + // Oracle returns a oracle. + rpc Oracle(QueryOracleRequest) returns (QueryOracleResponse) { + option (google.api.http).get = "/panacea/oracle/v2/oracles/{oracle_address}"; + } + + // OracleRegistrations returns a list of OracleRegistration. + rpc OracleRegistrations(QueryOracleRegistrationsRequest) returns (QueryOracleRegistrationsResponse) { + option (google.api.http).get = "/panacea/oracle/v2/oracle_registrations"; + } + + // OracleRegistration returns a OracleRegistration details. + rpc OracleRegistration(QueryOracleRegistrationRequest) returns (QueryOracleRegistrationResponse) { + option (google.api.http).get = "/panacea/oracle/v2/oracle_registrations/{unique_id}/{oracle_address}"; + } + + // Params returns params of oracle module. + rpc Params(QueryOracleParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/panacea/oracle/v2/params"; + } +} + +// QueryOraclesRequest is the request type for the Query/Oracles RPC method. +message QueryOraclesRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryOracleResponse is the response type for the Query/Oracles RPC method. +message QueryOraclesResponse { + repeated Oracle oracles = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryOracleRequest is the request type for the Query/Oracle RPC method. +message QueryOracleRequest { + string oracle_address = 1; +} + +// QueryOracleResponse is the response type for the Query/Oracle RPC method. +message QueryOracleResponse { + Oracle oracle = 1; +} + +// QueryOracleRegistrationsRequest is the request type for the Query/OracleRegistrations RPC method. +message QueryOracleRegistrationsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryOracleRegistrationsResponse is the response type for the Query/OracleRegistrations RPC method. +message QueryOracleRegistrationsResponse { + repeated OracleRegistration oracle_registrations = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryOracleRegistrationRequest is the request type for the Query/OracleRegistration RPC method. +message QueryOracleRegistrationRequest { + string unique_id = 1; + string oracle_address = 2; +} + +// QueryOracleRegistrationResponse is the response type for the Query/OracleRegistration RPC method. +message QueryOracleRegistrationResponse { + OracleRegistration oracle_registration = 1; +} + +// QueryOracleParamsRequest is the request type for the Query/OracleParams RPC method. +message QueryOracleParamsRequest {} + +// QueryParamsResponse is the response type for the Query/OracleParams RPC method. +message QueryParamsResponse { + Params params = 1; +} diff --git a/proto/panacea/oracle/v2/tx.proto b/proto/panacea/oracle/v2/tx.proto new file mode 100644 index 00000000..0250e87d --- /dev/null +++ b/proto/panacea/oracle/v2/tx.proto @@ -0,0 +1,67 @@ +syntax = "proto3"; +package panacea.oracle.v2; + +option go_package = "github.com/medibloc/panacea-core/x/oracle/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "panacea/oracle/v2/oracle.proto"; +import "panacea/oracle/v2/genesis.proto"; + +// Msg defines the Msg service. +service Msg { + // RegisterOracle defines a method for registration of oracle. + rpc RegisterOracle(MsgRegisterOracle) returns (MsgRegisterOracleResponse); + + // ApproveOracleRegistration defines a method to approve oracle registration + rpc ApproveOracleRegistration(MsgApproveOracleRegistration) returns (MsgApproveOracleRegistrationResponse); + + // UpgradeOracle defines a method for upgrade of oracle. + rpc UpdateOracleInfo(MsgUpdateOracleInfo) returns (MsgUpdateOracleInfoResponse); +} + +// MsgRegisterOracle defines the Msg/RegisterOracle request type. +message MsgRegisterOracle { + string unique_id = 1; + string oracle_address = 2; // panacea1.. account address + bytes node_pub_key = 3; + bytes node_pub_key_remote_report = 4; + int64 trusted_block_height = 5; + bytes trusted_block_hash = 6; + string endpoint = 7; + string oracle_commission_rate = 8 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +// MsgRegisterOracleResponse defines the Msg/RegisterOracle response type. +message MsgRegisterOracleResponse { +} + +// MsgApproveOracleRegistration defines the Msg/ApproveOracleRegistration +message MsgApproveOracleRegistration { + ApproveOracleRegistration approve_oracle_registration = 1; + bytes signature = 2; +} + +// ApproveOracleRegistration defines for oracle registration approval +message ApproveOracleRegistration { + string unique_id = 1; + string target_oracle_address = 2; + bytes encrypted_oracle_priv_key = 3; +} + +// MsgApproveOracleRegistrationResponse defines the Msg/ApproveOracleRegistration +message MsgApproveOracleRegistrationResponse { +} + +// MsgUpdateOracleInfo defines the Msg/UpdateOracleInfo +message MsgUpdateOracleInfo { + string oracle_address = 1; // panacea1.. account address + string endpoint = 2; + string oracle_commission_rate = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +// MsgUpdateOracleInfoResponse defines the Msg/UpdateOracleInfo +message MsgUpdateOracleInfoResponse { +} diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 0b19eb66..37bed170 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -30,5 +30,6 @@ Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. \ done ## move proto files to the right places -cp -r github.com/medibloc/panacea-core/* ./ -rm -rf github.com +find ./x -type f -name "*.pb*.go" -exec rm {} \; +cp -rv github.com/medibloc/panacea-core/x/* ./x/ +rm -rfv github.com \ No newline at end of file diff --git a/x/datadeal/types/certificate.pb.go b/x/datadeal/types/certificate.pb.go new file mode 100644 index 00000000..fef568c1 --- /dev/null +++ b/x/datadeal/types/certificate.pb.go @@ -0,0 +1,751 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: panacea/datadeal/v2/certificate.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Certificate defines a certificate with signature +type Certificate struct { + UnsignedCertificate *UnsignedCertificate `protobuf:"bytes,1,opt,name=unsigned_certificate,json=unsignedCertificate,proto3" json:"unsigned_certificate,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *Certificate) Reset() { *m = Certificate{} } +func (m *Certificate) String() string { return proto.CompactTextString(m) } +func (*Certificate) ProtoMessage() {} +func (*Certificate) Descriptor() ([]byte, []int) { + return fileDescriptor_e90678e908dbabdd, []int{0} +} +func (m *Certificate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Certificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Certificate.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Certificate) XXX_Merge(src proto.Message) { + xxx_messageInfo_Certificate.Merge(m, src) +} +func (m *Certificate) XXX_Size() int { + return m.Size() +} +func (m *Certificate) XXX_DiscardUnknown() { + xxx_messageInfo_Certificate.DiscardUnknown(m) +} + +var xxx_messageInfo_Certificate proto.InternalMessageInfo + +func (m *Certificate) GetUnsignedCertificate() *UnsignedCertificate { + if m != nil { + return m.UnsignedCertificate + } + return nil +} + +func (m *Certificate) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +// UnsignedCertificate defines a certificate information +type UnsignedCertificate struct { + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` + OracleAddress string `protobuf:"bytes,2,opt,name=oracle_address,json=oracleAddress,proto3" json:"oracle_address,omitempty"` + DealId int64 `protobuf:"varint,3,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` + ProviderAddress string `protobuf:"bytes,4,opt,name=provider_address,json=providerAddress,proto3" json:"provider_address,omitempty"` + DataHash string `protobuf:"bytes,5,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` +} + +func (m *UnsignedCertificate) Reset() { *m = UnsignedCertificate{} } +func (m *UnsignedCertificate) String() string { return proto.CompactTextString(m) } +func (*UnsignedCertificate) ProtoMessage() {} +func (*UnsignedCertificate) Descriptor() ([]byte, []int) { + return fileDescriptor_e90678e908dbabdd, []int{1} +} +func (m *UnsignedCertificate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UnsignedCertificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UnsignedCertificate.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UnsignedCertificate) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnsignedCertificate.Merge(m, src) +} +func (m *UnsignedCertificate) XXX_Size() int { + return m.Size() +} +func (m *UnsignedCertificate) XXX_DiscardUnknown() { + xxx_messageInfo_UnsignedCertificate.DiscardUnknown(m) +} + +var xxx_messageInfo_UnsignedCertificate proto.InternalMessageInfo + +func (m *UnsignedCertificate) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +func (m *UnsignedCertificate) GetOracleAddress() string { + if m != nil { + return m.OracleAddress + } + return "" +} + +func (m *UnsignedCertificate) GetDealId() int64 { + if m != nil { + return m.DealId + } + return 0 +} + +func (m *UnsignedCertificate) GetProviderAddress() string { + if m != nil { + return m.ProviderAddress + } + return "" +} + +func (m *UnsignedCertificate) GetDataHash() string { + if m != nil { + return m.DataHash + } + return "" +} + +func init() { + proto.RegisterType((*Certificate)(nil), "panacea.datadeal.v2.Certificate") + proto.RegisterType((*UnsignedCertificate)(nil), "panacea.datadeal.v2.UnsignedCertificate") +} + +func init() { + proto.RegisterFile("panacea/datadeal/v2/certificate.proto", fileDescriptor_e90678e908dbabdd) +} + +var fileDescriptor_e90678e908dbabdd = []byte{ + // 338 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcf, 0x4e, 0x2a, 0x31, + 0x14, 0x87, 0xe9, 0xe5, 0x8a, 0x4e, 0xf1, 0x0f, 0x29, 0x24, 0x4e, 0xd0, 0x34, 0x84, 0x84, 0x64, + 0x5c, 0x38, 0x8d, 0xf8, 0x04, 0xea, 0x46, 0xe3, 0x6e, 0x12, 0x37, 0xba, 0x98, 0x94, 0xb6, 0xce, + 0x34, 0x01, 0x3a, 0x69, 0x3b, 0x44, 0xdf, 0xc0, 0xa5, 0x6f, 0xe2, 0x6b, 0xb8, 0x64, 0xe9, 0xd2, + 0xc0, 0x8b, 0x98, 0x16, 0x10, 0x12, 0xd9, 0x75, 0xbe, 0xfe, 0xce, 0x77, 0xce, 0xf4, 0xc0, 0x5e, + 0x41, 0xc7, 0x94, 0x09, 0x4a, 0x38, 0xb5, 0x94, 0x0b, 0x3a, 0x24, 0x93, 0x3e, 0x61, 0x42, 0x5b, + 0xf9, 0x2c, 0x19, 0xb5, 0x22, 0x2e, 0xb4, 0xb2, 0x0a, 0x35, 0x97, 0xb1, 0x78, 0x15, 0x8b, 0x27, + 0xfd, 0x76, 0x2b, 0x53, 0x99, 0xf2, 0xf7, 0xc4, 0x9d, 0x16, 0xd1, 0x36, 0xde, 0x66, 0xf4, 0x25, + 0xfe, 0xbe, 0xfb, 0x06, 0x60, 0xfd, 0x66, 0xdd, 0x00, 0x3d, 0xc1, 0x56, 0x39, 0x36, 0x32, 0x1b, + 0x0b, 0x9e, 0x6e, 0x34, 0x0e, 0x41, 0x07, 0x44, 0xf5, 0x7e, 0x14, 0x6f, 0xe9, 0x1c, 0x3f, 0x2c, + 0x0b, 0x36, 0x3c, 0x49, 0xb3, 0xfc, 0x0b, 0xd1, 0x29, 0x0c, 0x1c, 0xa4, 0xb6, 0xd4, 0x22, 0xfc, + 0xd7, 0x01, 0xd1, 0x7e, 0xb2, 0x06, 0xdd, 0x0f, 0x00, 0x9b, 0x5b, 0x54, 0xa8, 0x01, 0xab, 0x4c, + 0x72, 0x3f, 0x41, 0x90, 0xb8, 0x23, 0xea, 0xc1, 0x43, 0xa5, 0x29, 0x1b, 0x8a, 0x94, 0x72, 0xae, + 0x85, 0x31, 0x5e, 0x16, 0x24, 0x07, 0x0b, 0x7a, 0xb5, 0x80, 0xe8, 0x18, 0xee, 0xba, 0x11, 0x53, + 0xc9, 0xc3, 0x6a, 0x07, 0x44, 0xd5, 0xa4, 0xe6, 0x3e, 0xef, 0x38, 0x3a, 0x83, 0x8d, 0x42, 0xab, + 0x89, 0xe4, 0x42, 0xff, 0x1a, 0xfe, 0x7b, 0xc3, 0xd1, 0x8a, 0xaf, 0x1c, 0x27, 0x30, 0x70, 0xbf, + 0x9a, 0xe6, 0xd4, 0xe4, 0xe1, 0x8e, 0xcf, 0xec, 0x39, 0x70, 0x4b, 0x4d, 0x7e, 0x7d, 0xff, 0x39, + 0xc3, 0x60, 0x3a, 0xc3, 0xe0, 0x7b, 0x86, 0xc1, 0xfb, 0x1c, 0x57, 0xa6, 0x73, 0x5c, 0xf9, 0x9a, + 0xe3, 0xca, 0xe3, 0x45, 0x26, 0x6d, 0x5e, 0x0e, 0x62, 0xa6, 0x46, 0x64, 0x24, 0xb8, 0x1c, 0x0c, + 0x15, 0x23, 0xcb, 0xb7, 0x3b, 0x67, 0x4a, 0x0b, 0xf2, 0xb2, 0xde, 0x88, 0x7d, 0x2d, 0x84, 0x19, + 0xd4, 0xfc, 0x42, 0x2e, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x8b, 0x25, 0x3c, 0x63, 0x04, 0x02, + 0x00, 0x00, +} + +func (m *Certificate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Certificate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Certificate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintCertificate(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x12 + } + if m.UnsignedCertificate != nil { + { + size, err := m.UnsignedCertificate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCertificate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UnsignedCertificate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UnsignedCertificate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnsignedCertificate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DataHash) > 0 { + i -= len(m.DataHash) + copy(dAtA[i:], m.DataHash) + i = encodeVarintCertificate(dAtA, i, uint64(len(m.DataHash))) + i-- + dAtA[i] = 0x2a + } + if len(m.ProviderAddress) > 0 { + i -= len(m.ProviderAddress) + copy(dAtA[i:], m.ProviderAddress) + i = encodeVarintCertificate(dAtA, i, uint64(len(m.ProviderAddress))) + i-- + dAtA[i] = 0x22 + } + if m.DealId != 0 { + i = encodeVarintCertificate(dAtA, i, uint64(m.DealId)) + i-- + dAtA[i] = 0x18 + } + if len(m.OracleAddress) > 0 { + i -= len(m.OracleAddress) + copy(dAtA[i:], m.OracleAddress) + i = encodeVarintCertificate(dAtA, i, uint64(len(m.OracleAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintCertificate(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintCertificate(dAtA []byte, offset int, v uint64) int { + offset -= sovCertificate(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Certificate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.UnsignedCertificate != nil { + l = m.UnsignedCertificate.Size() + n += 1 + l + sovCertificate(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovCertificate(uint64(l)) + } + return n +} + +func (m *UnsignedCertificate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovCertificate(uint64(l)) + } + l = len(m.OracleAddress) + if l > 0 { + n += 1 + l + sovCertificate(uint64(l)) + } + if m.DealId != 0 { + n += 1 + sovCertificate(uint64(m.DealId)) + } + l = len(m.ProviderAddress) + if l > 0 { + n += 1 + l + sovCertificate(uint64(l)) + } + l = len(m.DataHash) + if l > 0 { + n += 1 + l + sovCertificate(uint64(l)) + } + return n +} + +func sovCertificate(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCertificate(x uint64) (n int) { + return sovCertificate(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Certificate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCertificate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Certificate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Certificate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnsignedCertificate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCertificate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCertificate + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCertificate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UnsignedCertificate == nil { + m.UnsignedCertificate = &UnsignedCertificate{} + } + if err := m.UnsignedCertificate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCertificate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCertificate + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCertificate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCertificate(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCertificate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UnsignedCertificate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCertificate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UnsignedCertificate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UnsignedCertificate: 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 ErrIntOverflowCertificate + } + 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 ErrInvalidLengthCertificate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCertificate + } + 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 OracleAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCertificate + } + 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 ErrInvalidLengthCertificate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCertificate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OracleAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DealId", wireType) + } + m.DealId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCertificate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DealId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCertificate + } + 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 ErrInvalidLengthCertificate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCertificate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProviderAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCertificate + } + 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 ErrInvalidLengthCertificate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCertificate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCertificate(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCertificate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCertificate(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, ErrIntOverflowCertificate + } + 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, ErrIntOverflowCertificate + } + 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, ErrIntOverflowCertificate + } + 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, ErrInvalidLengthCertificate + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCertificate + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthCertificate + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthCertificate = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCertificate = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCertificate = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/datadeal/types/deal.pb.go b/x/datadeal/types/deal.pb.go new file mode 100644 index 00000000..525b2e86 --- /dev/null +++ b/x/datadeal/types/deal.pb.go @@ -0,0 +1,678 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: panacea/datadeal/v2/deal.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// DealStatus enumerates the status of deal. +type DealStatus int32 + +const ( + // DEAL_STATUS_UNSPECIFIED + DEAL_STATUS_UNSPECIFIED DealStatus = 0 + // DEAL_STATUS_ACTIVE defines the deal status that is active. + DEAL_STATUS_ACTIVE DealStatus = 1 + // DEAL_STATUS_INACTIVE defines the deal status that is inactive. + DEAL_STATUS_INACTIVE DealStatus = 2 + // DEAL_STATUS_COMPLETED defines the deal status that is completed. + DEAL_STATUS_COMPLETED DealStatus = 3 +) + +var DealStatus_name = map[int32]string{ + 0: "DEAL_STATUS_UNSPECIFIED", + 1: "DEAL_STATUS_ACTIVE", + 2: "DEAL_STATUS_INACTIVE", + 3: "DEAL_STATUS_COMPLETED", +} + +var DealStatus_value = map[string]int32{ + "DEAL_STATUS_UNSPECIFIED": 0, + "DEAL_STATUS_ACTIVE": 1, + "DEAL_STATUS_INACTIVE": 2, + "DEAL_STATUS_COMPLETED": 3, +} + +func (x DealStatus) String() string { + return proto.EnumName(DealStatus_name, int32(x)) +} + +func (DealStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_45d9ced3b49eab12, []int{0} +} + +// Deal defines a deal. +type Deal struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + DataSchema []string `protobuf:"bytes,3,rep,name=data_schema,json=dataSchema,proto3" json:"data_schema,omitempty"` + Budget *types.Coin `protobuf:"bytes,4,opt,name=budget,proto3" json:"budget,omitempty"` + MaxNumData uint64 `protobuf:"varint,5,opt,name=max_num_data,json=maxNumData,proto3" json:"max_num_data,omitempty"` + CurNumData uint64 `protobuf:"varint,6,opt,name=cur_num_data,json=curNumData,proto3" json:"cur_num_data,omitempty"` + ConsumerAddress string `protobuf:"bytes,7,opt,name=consumer_address,json=consumerAddress,proto3" json:"consumer_address,omitempty"` + Status DealStatus `protobuf:"varint,8,opt,name=status,proto3,enum=panacea.datadeal.v2.DealStatus" json:"status,omitempty"` +} + +func (m *Deal) Reset() { *m = Deal{} } +func (m *Deal) String() string { return proto.CompactTextString(m) } +func (*Deal) ProtoMessage() {} +func (*Deal) Descriptor() ([]byte, []int) { + return fileDescriptor_45d9ced3b49eab12, []int{0} +} +func (m *Deal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Deal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Deal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Deal) XXX_Merge(src proto.Message) { + xxx_messageInfo_Deal.Merge(m, src) +} +func (m *Deal) XXX_Size() int { + return m.Size() +} +func (m *Deal) XXX_DiscardUnknown() { + xxx_messageInfo_Deal.DiscardUnknown(m) +} + +var xxx_messageInfo_Deal proto.InternalMessageInfo + +func (m *Deal) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Deal) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Deal) GetDataSchema() []string { + if m != nil { + return m.DataSchema + } + return nil +} + +func (m *Deal) GetBudget() *types.Coin { + if m != nil { + return m.Budget + } + return nil +} + +func (m *Deal) GetMaxNumData() uint64 { + if m != nil { + return m.MaxNumData + } + return 0 +} + +func (m *Deal) GetCurNumData() uint64 { + if m != nil { + return m.CurNumData + } + return 0 +} + +func (m *Deal) GetConsumerAddress() string { + if m != nil { + return m.ConsumerAddress + } + return "" +} + +func (m *Deal) GetStatus() DealStatus { + if m != nil { + return m.Status + } + return DEAL_STATUS_UNSPECIFIED +} + +func init() { + proto.RegisterEnum("panacea.datadeal.v2.DealStatus", DealStatus_name, DealStatus_value) + proto.RegisterType((*Deal)(nil), "panacea.datadeal.v2.Deal") +} + +func init() { proto.RegisterFile("panacea/datadeal/v2/deal.proto", fileDescriptor_45d9ced3b49eab12) } + +var fileDescriptor_45d9ced3b49eab12 = []byte{ + // 444 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xb1, 0x8e, 0xd3, 0x3e, + 0x1c, 0xc7, 0xe3, 0xb4, 0xff, 0xde, 0xff, 0x7c, 0xe8, 0xa8, 0xcc, 0x01, 0xb9, 0x22, 0xf9, 0x22, + 0xa6, 0x80, 0x84, 0xad, 0x96, 0x81, 0xb9, 0x34, 0x41, 0xaa, 0x38, 0xca, 0x29, 0xe9, 0x31, 0xb0, + 0x44, 0x8e, 0x63, 0xf5, 0x22, 0xd5, 0x71, 0x15, 0x3b, 0x55, 0x91, 0x78, 0x00, 0x46, 0xde, 0x81, + 0x95, 0x07, 0x61, 0xbc, 0x91, 0x11, 0xb5, 0x2f, 0x82, 0x92, 0x26, 0x6a, 0x07, 0xa6, 0x24, 0xdf, + 0xcf, 0x47, 0xf1, 0xd7, 0x3f, 0xfd, 0x20, 0x5e, 0xb1, 0x9c, 0x71, 0xc1, 0x68, 0xca, 0x0c, 0x4b, + 0x05, 0x5b, 0xd2, 0xf5, 0x88, 0x56, 0x4f, 0xb2, 0x2a, 0x94, 0x51, 0xe8, 0x51, 0xc3, 0x49, 0xcb, + 0xc9, 0x7a, 0x34, 0xb8, 0x58, 0xa8, 0x85, 0xaa, 0x39, 0xad, 0xde, 0xf6, 0xea, 0x00, 0x73, 0xa5, + 0xa5, 0xd2, 0x34, 0x61, 0x5a, 0xd0, 0xf5, 0x30, 0x11, 0x86, 0x0d, 0x29, 0x57, 0x59, 0xbe, 0xe7, + 0xcf, 0x7f, 0xda, 0xb0, 0xeb, 0x0b, 0xb6, 0x44, 0xe7, 0xd0, 0xce, 0x52, 0x07, 0xb8, 0xc0, 0xeb, + 0x86, 0x76, 0x96, 0x22, 0x07, 0x9e, 0xb0, 0x34, 0x2d, 0x84, 0xd6, 0x8e, 0xed, 0x02, 0xef, 0x34, + 0x6c, 0x3f, 0xd1, 0x15, 0x3c, 0xab, 0xce, 0x8d, 0x35, 0xbf, 0x13, 0x92, 0x39, 0x1d, 0xb7, 0xe3, + 0x9d, 0x86, 0xb0, 0x8a, 0xa2, 0x3a, 0x41, 0x43, 0xd8, 0x4b, 0xca, 0x74, 0x21, 0x8c, 0xd3, 0x75, + 0x81, 0x77, 0x36, 0xba, 0x24, 0xfb, 0x12, 0xa4, 0x2a, 0x41, 0x9a, 0x12, 0x64, 0xa2, 0xb2, 0x3c, + 0x6c, 0x44, 0xe4, 0xc2, 0x07, 0x92, 0x6d, 0xe2, 0xbc, 0x94, 0x71, 0xf5, 0x23, 0xe7, 0xbf, 0xba, + 0x07, 0x94, 0x6c, 0x33, 0x2b, 0xa5, 0xcf, 0x0c, 0xab, 0x0c, 0x5e, 0x16, 0x07, 0xa3, 0xb7, 0x37, + 0x78, 0x59, 0xb4, 0xc6, 0x0b, 0xd8, 0xe7, 0x2a, 0xd7, 0xa5, 0x14, 0x45, 0xdc, 0x56, 0x3f, 0xa9, + 0xab, 0x3f, 0x6c, 0xf3, 0x71, 0x73, 0x85, 0x37, 0xb0, 0xa7, 0x0d, 0x33, 0xa5, 0x76, 0xfe, 0x77, + 0x81, 0x77, 0x3e, 0xba, 0x22, 0xff, 0x98, 0x28, 0xa9, 0xe6, 0x12, 0xd5, 0x5a, 0xd8, 0xe8, 0x2f, + 0xbf, 0x42, 0x78, 0x48, 0xd1, 0x33, 0xf8, 0xd4, 0x0f, 0xc6, 0xd7, 0x71, 0x34, 0x1f, 0xcf, 0x6f, + 0xa3, 0xf8, 0x76, 0x16, 0xdd, 0x04, 0x93, 0xe9, 0xbb, 0x69, 0xe0, 0xf7, 0x2d, 0xf4, 0x04, 0xa2, + 0x63, 0x38, 0x9e, 0xcc, 0xa7, 0x9f, 0x82, 0x3e, 0x40, 0x0e, 0xbc, 0x38, 0xce, 0xa7, 0xb3, 0x86, + 0xd8, 0xe8, 0x12, 0x3e, 0x3e, 0x26, 0x93, 0x8f, 0x1f, 0x6e, 0xae, 0x83, 0x79, 0xe0, 0xf7, 0x3b, + 0x83, 0xee, 0xb7, 0x1f, 0xd8, 0x7a, 0xfb, 0xfe, 0xd7, 0x16, 0x83, 0xfb, 0x2d, 0x06, 0x7f, 0xb6, + 0x18, 0x7c, 0xdf, 0x61, 0xeb, 0x7e, 0x87, 0xad, 0xdf, 0x3b, 0x6c, 0x7d, 0x1e, 0x2e, 0x32, 0x73, + 0x57, 0x26, 0x84, 0x2b, 0x49, 0xa5, 0x48, 0xb3, 0x64, 0xa9, 0x38, 0x6d, 0xee, 0xf4, 0x8a, 0xab, + 0x42, 0xd0, 0xcd, 0x61, 0x99, 0xcc, 0x97, 0x95, 0xd0, 0x49, 0xaf, 0x5e, 0x80, 0xd7, 0x7f, 0x03, + 0x00, 0x00, 0xff, 0xff, 0xfd, 0x7b, 0x84, 0xff, 0x6d, 0x02, 0x00, 0x00, +} + +func (m *Deal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Deal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Deal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintDeal(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x40 + } + if len(m.ConsumerAddress) > 0 { + i -= len(m.ConsumerAddress) + copy(dAtA[i:], m.ConsumerAddress) + i = encodeVarintDeal(dAtA, i, uint64(len(m.ConsumerAddress))) + i-- + dAtA[i] = 0x3a + } + if m.CurNumData != 0 { + i = encodeVarintDeal(dAtA, i, uint64(m.CurNumData)) + i-- + dAtA[i] = 0x30 + } + if m.MaxNumData != 0 { + i = encodeVarintDeal(dAtA, i, uint64(m.MaxNumData)) + i-- + dAtA[i] = 0x28 + } + if m.Budget != nil { + { + size, err := m.Budget.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDeal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.DataSchema) > 0 { + for iNdEx := len(m.DataSchema) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DataSchema[iNdEx]) + copy(dAtA[i:], m.DataSchema[iNdEx]) + i = encodeVarintDeal(dAtA, i, uint64(len(m.DataSchema[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintDeal(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintDeal(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintDeal(dAtA []byte, offset int, v uint64) int { + offset -= sovDeal(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Deal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovDeal(uint64(m.Id)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovDeal(uint64(l)) + } + if len(m.DataSchema) > 0 { + for _, s := range m.DataSchema { + l = len(s) + n += 1 + l + sovDeal(uint64(l)) + } + } + if m.Budget != nil { + l = m.Budget.Size() + n += 1 + l + sovDeal(uint64(l)) + } + if m.MaxNumData != 0 { + n += 1 + sovDeal(uint64(m.MaxNumData)) + } + if m.CurNumData != 0 { + n += 1 + sovDeal(uint64(m.CurNumData)) + } + l = len(m.ConsumerAddress) + if l > 0 { + n += 1 + l + sovDeal(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovDeal(uint64(m.Status)) + } + return n +} + +func sovDeal(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozDeal(x uint64) (n int) { + return sovDeal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Deal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDeal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Deal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Deal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDeal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDeal + } + 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 ErrInvalidLengthDeal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDeal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataSchema", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDeal + } + 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 ErrInvalidLengthDeal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDeal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataSchema = append(m.DataSchema, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Budget", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDeal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDeal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDeal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Budget == nil { + m.Budget = &types.Coin{} + } + if err := m.Budget.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxNumData", wireType) + } + m.MaxNumData = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDeal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxNumData |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurNumData", wireType) + } + m.CurNumData = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDeal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurNumData |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDeal + } + 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 ErrInvalidLengthDeal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDeal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDeal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= DealStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDeal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDeal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDeal(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, ErrIntOverflowDeal + } + 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, ErrIntOverflowDeal + } + 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, ErrIntOverflowDeal + } + 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, ErrInvalidLengthDeal + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDeal + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthDeal + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthDeal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDeal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDeal = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/datadeal/types/genesis.pb.go b/x/datadeal/types/genesis.pb.go new file mode 100644 index 00000000..487e910d --- /dev/null +++ b/x/datadeal/types/genesis.pb.go @@ -0,0 +1,434 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: panacea/datadeal/v2/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/protobuf/types/known/timestamppb" + 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 datadeal module's genesis state. +type GenesisState struct { + NextDealNumber uint64 `protobuf:"varint,1,opt,name=next_deal_number,json=nextDealNumber,proto3" json:"next_deal_number,omitempty"` + Deals []Deal `protobuf:"bytes,2,rep,name=deals,proto3" json:"deals"` + Certificates []Certificate `protobuf:"bytes,3,rep,name=certificates,proto3" json:"certificates"` +} + +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_4930434e4830666e, []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) GetNextDealNumber() uint64 { + if m != nil { + return m.NextDealNumber + } + return 0 +} + +func (m *GenesisState) GetDeals() []Deal { + if m != nil { + return m.Deals + } + return nil +} + +func (m *GenesisState) GetCertificates() []Certificate { + if m != nil { + return m.Certificates + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "panacea.datadeal.v2.GenesisState") +} + +func init() { proto.RegisterFile("panacea/datadeal/v2/genesis.proto", fileDescriptor_4930434e4830666e) } + +var fileDescriptor_4930434e4830666e = []byte{ + // 302 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xcf, 0x4a, 0xf3, 0x40, + 0x14, 0xc5, 0x33, 0x5f, 0xfb, 0xb9, 0x88, 0x45, 0x24, 0xba, 0xa8, 0x5d, 0x4c, 0xa3, 0x20, 0x64, + 0xe3, 0x0c, 0x46, 0x7c, 0x81, 0x2a, 0x08, 0x0a, 0x2e, 0xea, 0xce, 0x4d, 0x99, 0x4c, 0x6e, 0xc7, + 0x81, 0x24, 0x13, 0x32, 0x93, 0x52, 0xdf, 0xc2, 0xf7, 0xf1, 0x05, 0xba, 0xec, 0xd2, 0x95, 0x48, + 0xf2, 0x22, 0x92, 0x49, 0xa4, 0x0a, 0xd9, 0xcd, 0xdc, 0xf3, 0x3b, 0xf7, 0xcf, 0x71, 0x4f, 0x73, + 0x96, 0x31, 0x0e, 0x8c, 0xc6, 0xcc, 0xb0, 0x18, 0x58, 0x42, 0x57, 0x21, 0x15, 0x90, 0x81, 0x96, + 0x9a, 0xe4, 0x85, 0x32, 0xca, 0x3b, 0xea, 0x10, 0xf2, 0x83, 0x90, 0x55, 0x38, 0x39, 0x16, 0x4a, + 0x28, 0xab, 0xd3, 0xe6, 0xd5, 0xa2, 0x93, 0xa9, 0x50, 0x4a, 0x24, 0x40, 0xed, 0x2f, 0x2a, 0x97, + 0xd4, 0xc8, 0x14, 0xb4, 0x61, 0x69, 0xde, 0x01, 0xb8, 0x6f, 0x9c, 0xed, 0xd9, 0xea, 0xe7, 0x7d, + 0x3a, 0x87, 0xc2, 0xc8, 0xa5, 0xe4, 0xcc, 0x40, 0x8b, 0x9d, 0xbd, 0x23, 0x77, 0x74, 0xd7, 0x2e, + 0xf9, 0x64, 0x98, 0x01, 0x2f, 0x70, 0x0f, 0x33, 0x58, 0x9b, 0x45, 0x63, 0x59, 0x64, 0x65, 0x1a, + 0x41, 0x31, 0x46, 0x3e, 0x0a, 0x86, 0xf3, 0x83, 0xa6, 0x7e, 0x0b, 0x2c, 0x79, 0xb4, 0x55, 0xef, + 0xda, 0xfd, 0xdf, 0x40, 0x7a, 0xfc, 0xcf, 0x1f, 0x04, 0xfb, 0xe1, 0x09, 0xe9, 0xb9, 0x8e, 0x34, + 0xfc, 0x6c, 0xb8, 0xf9, 0x9c, 0x3a, 0xf3, 0x96, 0xf6, 0xee, 0xdd, 0xd1, 0xaf, 0x35, 0xf4, 0x78, + 0x60, 0xdd, 0x7e, 0xaf, 0xfb, 0x66, 0x07, 0x76, 0x4d, 0xfe, 0x78, 0x67, 0x0f, 0x9b, 0x0a, 0xa3, + 0x6d, 0x85, 0xd1, 0x57, 0x85, 0xd1, 0x5b, 0x8d, 0x9d, 0x6d, 0x8d, 0x9d, 0x8f, 0x1a, 0x3b, 0xcf, + 0x97, 0x42, 0x9a, 0x97, 0x32, 0x22, 0x5c, 0xa5, 0x34, 0x85, 0x58, 0x46, 0x89, 0xe2, 0xb4, 0x1b, + 0x71, 0xc1, 0x55, 0x01, 0x74, 0xbd, 0x4b, 0xc6, 0xbc, 0xe6, 0xa0, 0xa3, 0x3d, 0x9b, 0xc8, 0xd5, + 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf1, 0x76, 0xa7, 0x2e, 0xc9, 0x01, 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.Certificates) > 0 { + for iNdEx := len(m.Certificates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Certificates[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.Deals) > 0 { + for iNdEx := len(m.Deals) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Deals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.NextDealNumber != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.NextDealNumber)) + i-- + dAtA[i] = 0x8 + } + 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 + if m.NextDealNumber != 0 { + n += 1 + sovGenesis(uint64(m.NextDealNumber)) + } + if len(m.Deals) > 0 { + for _, e := range m.Deals { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Certificates) > 0 { + for _, e := range m.Certificates { + 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextDealNumber", wireType) + } + m.NextDealNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextDealNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deals", 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.Deals = append(m.Deals, Deal{}) + if err := m.Deals[len(m.Deals)-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 Certificates", 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.Certificates = append(m.Certificates, Certificate{}) + if err := m.Certificates[len(m.Certificates)-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/datadeal/types/query.pb.go b/x/datadeal/types/query.pb.go new file mode 100644 index 00000000..5383ae05 --- /dev/null +++ b/x/datadeal/types/query.pb.go @@ -0,0 +1,1975 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: panacea/datadeal/v2/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "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 + +// QueryDealsRequest defines the request type for the Query/Deals RPC method. +type QueryDealsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDealsRequest) Reset() { *m = QueryDealsRequest{} } +func (m *QueryDealsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDealsRequest) ProtoMessage() {} +func (*QueryDealsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4c7a445ecc4b9161, []int{0} +} +func (m *QueryDealsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDealsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDealsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDealsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDealsRequest.Merge(m, src) +} +func (m *QueryDealsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDealsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDealsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDealsRequest proto.InternalMessageInfo + +func (m *QueryDealsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryDealsResponse defines the response type for the Query/Deals RPC method. +type QueryDealsResponse struct { + Deal []*Deal `protobuf:"bytes,1,rep,name=deal,proto3" json:"deal,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDealsResponse) Reset() { *m = QueryDealsResponse{} } +func (m *QueryDealsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDealsResponse) ProtoMessage() {} +func (*QueryDealsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4c7a445ecc4b9161, []int{1} +} +func (m *QueryDealsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDealsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDealsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDealsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDealsResponse.Merge(m, src) +} +func (m *QueryDealsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDealsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDealsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDealsResponse proto.InternalMessageInfo + +func (m *QueryDealsResponse) GetDeal() []*Deal { + if m != nil { + return m.Deal + } + return nil +} + +func (m *QueryDealsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryDealRequest defines the request type for the Query/Deal RPC method. +type QueryDealRequest struct { + DealId uint64 `protobuf:"varint,1,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` +} + +func (m *QueryDealRequest) Reset() { *m = QueryDealRequest{} } +func (m *QueryDealRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDealRequest) ProtoMessage() {} +func (*QueryDealRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4c7a445ecc4b9161, []int{2} +} +func (m *QueryDealRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDealRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDealRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDealRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDealRequest.Merge(m, src) +} +func (m *QueryDealRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDealRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDealRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDealRequest proto.InternalMessageInfo + +func (m *QueryDealRequest) GetDealId() uint64 { + if m != nil { + return m.DealId + } + return 0 +} + +// QueryDealResponse defines the response type for the Query/Deal RPC method. +type QueryDealResponse struct { + Deal *Deal `protobuf:"bytes,1,opt,name=deal,proto3" json:"deal,omitempty"` +} + +func (m *QueryDealResponse) Reset() { *m = QueryDealResponse{} } +func (m *QueryDealResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDealResponse) ProtoMessage() {} +func (*QueryDealResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4c7a445ecc4b9161, []int{3} +} +func (m *QueryDealResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDealResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDealResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDealResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDealResponse.Merge(m, src) +} +func (m *QueryDealResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDealResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDealResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDealResponse proto.InternalMessageInfo + +func (m *QueryDealResponse) GetDeal() *Deal { + if m != nil { + return m.Deal + } + return nil +} + +// QueryDealsRequest defines the request type for the Query/Deals RPC method. +type QueryCertificates struct { + DealId int64 `protobuf:"varint,1,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryCertificates) Reset() { *m = QueryCertificates{} } +func (m *QueryCertificates) String() string { return proto.CompactTextString(m) } +func (*QueryCertificates) ProtoMessage() {} +func (*QueryCertificates) Descriptor() ([]byte, []int) { + return fileDescriptor_4c7a445ecc4b9161, []int{4} +} +func (m *QueryCertificates) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCertificates) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCertificates.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCertificates) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCertificates.Merge(m, src) +} +func (m *QueryCertificates) XXX_Size() int { + return m.Size() +} +func (m *QueryCertificates) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCertificates.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCertificates proto.InternalMessageInfo + +func (m *QueryCertificates) GetDealId() int64 { + if m != nil { + return m.DealId + } + return 0 +} + +func (m *QueryCertificates) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryDealsResponse defines the response type for the Query/Deals RPC method. +type QueryCertificatesResponse struct { + Certificates []*Certificate `protobuf:"bytes,1,rep,name=certificates,proto3" json:"certificates,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryCertificatesResponse) Reset() { *m = QueryCertificatesResponse{} } +func (m *QueryCertificatesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCertificatesResponse) ProtoMessage() {} +func (*QueryCertificatesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4c7a445ecc4b9161, []int{5} +} +func (m *QueryCertificatesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCertificatesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCertificatesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCertificatesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCertificatesResponse.Merge(m, src) +} +func (m *QueryCertificatesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCertificatesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCertificatesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCertificatesResponse proto.InternalMessageInfo + +func (m *QueryCertificatesResponse) GetCertificates() []*Certificate { + if m != nil { + return m.Certificates + } + return nil +} + +func (m *QueryCertificatesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryCertificate defines the request type for the Query/Certificate RPC method. +type QueryCertificate struct { + DealId uint64 `protobuf:"varint,1,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` + DataHash string `protobuf:"bytes,2,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` +} + +func (m *QueryCertificate) Reset() { *m = QueryCertificate{} } +func (m *QueryCertificate) String() string { return proto.CompactTextString(m) } +func (*QueryCertificate) ProtoMessage() {} +func (*QueryCertificate) Descriptor() ([]byte, []int) { + return fileDescriptor_4c7a445ecc4b9161, []int{6} +} +func (m *QueryCertificate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCertificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCertificate.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCertificate) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCertificate.Merge(m, src) +} +func (m *QueryCertificate) XXX_Size() int { + return m.Size() +} +func (m *QueryCertificate) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCertificate.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCertificate proto.InternalMessageInfo + +func (m *QueryCertificate) GetDealId() uint64 { + if m != nil { + return m.DealId + } + return 0 +} + +func (m *QueryCertificate) GetDataHash() string { + if m != nil { + return m.DataHash + } + return "" +} + +// QueryCertificateResponse defines the response type for the Query/Certificate RPC method. +type QueryCertificateResponse struct { + Certificate *Certificate `protobuf:"bytes,1,opt,name=certificate,proto3" json:"certificate,omitempty"` +} + +func (m *QueryCertificateResponse) Reset() { *m = QueryCertificateResponse{} } +func (m *QueryCertificateResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCertificateResponse) ProtoMessage() {} +func (*QueryCertificateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4c7a445ecc4b9161, []int{7} +} +func (m *QueryCertificateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCertificateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCertificateResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCertificateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCertificateResponse.Merge(m, src) +} +func (m *QueryCertificateResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCertificateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCertificateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCertificateResponse proto.InternalMessageInfo + +func (m *QueryCertificateResponse) GetCertificate() *Certificate { + if m != nil { + return m.Certificate + } + return nil +} + +func init() { + proto.RegisterType((*QueryDealsRequest)(nil), "panacea.datadeal.v2.QueryDealsRequest") + proto.RegisterType((*QueryDealsResponse)(nil), "panacea.datadeal.v2.QueryDealsResponse") + proto.RegisterType((*QueryDealRequest)(nil), "panacea.datadeal.v2.QueryDealRequest") + proto.RegisterType((*QueryDealResponse)(nil), "panacea.datadeal.v2.QueryDealResponse") + proto.RegisterType((*QueryCertificates)(nil), "panacea.datadeal.v2.QueryCertificates") + proto.RegisterType((*QueryCertificatesResponse)(nil), "panacea.datadeal.v2.QueryCertificatesResponse") + proto.RegisterType((*QueryCertificate)(nil), "panacea.datadeal.v2.QueryCertificate") + proto.RegisterType((*QueryCertificateResponse)(nil), "panacea.datadeal.v2.QueryCertificateResponse") +} + +func init() { proto.RegisterFile("panacea/datadeal/v2/query.proto", fileDescriptor_4c7a445ecc4b9161) } + +var fileDescriptor_4c7a445ecc4b9161 = []byte{ + // 590 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4f, 0x6f, 0x12, 0x41, + 0x18, 0xc6, 0x19, 0x4a, 0xab, 0x1d, 0x7a, 0xd0, 0xd1, 0x44, 0xba, 0x36, 0x2b, 0xd9, 0x08, 0x6d, + 0x54, 0x66, 0x02, 0x3d, 0x79, 0x30, 0x26, 0x58, 0xb5, 0xc6, 0x8b, 0xee, 0x51, 0x13, 0x9b, 0x61, + 0x19, 0x97, 0x4d, 0x60, 0x67, 0xcb, 0x0c, 0xc4, 0xa6, 0xf6, 0xa2, 0x57, 0x0f, 0x26, 0x7e, 0x02, + 0xaf, 0xfd, 0x24, 0x1e, 0x9b, 0x78, 0xf1, 0xe0, 0xc1, 0x80, 0x1f, 0xc4, 0xec, 0xec, 0xb0, 0x2c, + 0x74, 0x29, 0xab, 0xf1, 0x06, 0xbc, 0xcf, 0xfb, 0x3e, 0xbf, 0xf7, 0xcf, 0x00, 0x6f, 0x05, 0xd4, + 0xa7, 0x0e, 0xa3, 0xa4, 0x4d, 0x25, 0x6d, 0x33, 0xda, 0x25, 0xc3, 0x06, 0x39, 0x1c, 0xb0, 0xfe, + 0x11, 0x0e, 0xfa, 0x5c, 0x72, 0x74, 0x4d, 0x0b, 0xf0, 0x44, 0x80, 0x87, 0x0d, 0xe3, 0xba, 0xcb, + 0x5d, 0xae, 0xe2, 0x24, 0xfc, 0x14, 0x49, 0x8d, 0x3b, 0x0e, 0x17, 0x3d, 0x2e, 0x48, 0x8b, 0x0a, + 0x16, 0xd5, 0x20, 0xc3, 0x7a, 0x8b, 0x49, 0x5a, 0x27, 0x01, 0x75, 0x3d, 0x9f, 0x4a, 0x8f, 0xfb, + 0x5a, 0xbb, 0xe5, 0x72, 0xee, 0x76, 0x19, 0xa1, 0x81, 0x47, 0xa8, 0xef, 0x73, 0xa9, 0x82, 0x42, + 0x47, 0xcd, 0x34, 0x2a, 0x65, 0x1e, 0xc5, 0x2b, 0x69, 0x71, 0x87, 0xf5, 0xa5, 0xf7, 0xd6, 0x73, + 0xa8, 0x64, 0x91, 0xcc, 0x7a, 0x0d, 0xaf, 0xbe, 0x0c, 0x31, 0xf6, 0x18, 0xed, 0x0a, 0x9b, 0x1d, + 0x0e, 0x98, 0x90, 0xe8, 0x09, 0x84, 0x53, 0x9a, 0x12, 0x28, 0x83, 0x9d, 0x62, 0xa3, 0x8a, 0x23, + 0x74, 0x1c, 0xa2, 0xe3, 0xa8, 0x7d, 0x8d, 0x8e, 0x5f, 0x50, 0x97, 0xe9, 0x5c, 0x3b, 0x91, 0x69, + 0x7d, 0x02, 0x10, 0x25, 0xab, 0x8b, 0x80, 0xfb, 0x82, 0xa1, 0x1a, 0x2c, 0x84, 0x40, 0x25, 0x50, + 0x5e, 0xd9, 0x29, 0x36, 0x36, 0x71, 0xca, 0xf8, 0x70, 0x98, 0x61, 0x2b, 0x19, 0x7a, 0x3a, 0x43, + 0x93, 0x57, 0x34, 0xdb, 0x4b, 0x69, 0x22, 0xaf, 0x19, 0x9c, 0xbb, 0xf0, 0x4a, 0x4c, 0x33, 0x69, + 0xf5, 0x06, 0xbc, 0x14, 0x9a, 0x1c, 0x78, 0x6d, 0xd5, 0x67, 0xc1, 0x5e, 0x0b, 0xbf, 0x3e, 0x6b, + 0x5b, 0xcd, 0xc4, 0x60, 0x52, 0xc8, 0x41, 0x06, 0x72, 0x4b, 0xea, 0x1a, 0x8f, 0xa6, 0x63, 0x17, + 0xf3, 0x8e, 0x2b, 0x13, 0xc7, 0xb9, 0xa9, 0xe7, 0xff, 0x79, 0xea, 0xa7, 0x00, 0x6e, 0x9e, 0xb3, + 0x8d, 0x5b, 0xd8, 0x83, 0x1b, 0x89, 0x2b, 0x10, 0x7a, 0x09, 0xe5, 0xd4, 0x56, 0x12, 0x05, 0xec, + 0x99, 0xac, 0xff, 0xb7, 0x93, 0x7d, 0xbd, 0x93, 0x84, 0xd5, 0xc2, 0x9d, 0xa0, 0x9b, 0x70, 0x3d, + 0xc4, 0x3b, 0xe8, 0x50, 0xd1, 0x51, 0xa6, 0xeb, 0xf6, 0xe5, 0xf0, 0x87, 0x7d, 0x2a, 0x3a, 0xd6, + 0x1b, 0x58, 0x9a, 0xaf, 0x14, 0x37, 0xdd, 0x84, 0xc5, 0x04, 0xbe, 0x5e, 0xdf, 0xf2, 0x9e, 0x93, + 0x49, 0x8d, 0x9f, 0x05, 0xb8, 0xaa, 0x0c, 0xd0, 0x7b, 0xb8, 0xaa, 0x0e, 0x1a, 0x55, 0x53, 0x2b, + 0x9c, 0x7b, 0x4f, 0xc6, 0xf6, 0x52, 0x5d, 0xc4, 0x69, 0x59, 0x1f, 0xbe, 0xff, 0xfe, 0x92, 0xdf, + 0x42, 0x06, 0x59, 0xf4, 0xba, 0x05, 0xfa, 0x08, 0x60, 0x21, 0xcc, 0x42, 0x95, 0x8b, 0xab, 0x4e, + 0xcc, 0xab, 0xcb, 0x64, 0xda, 0xfb, 0x9e, 0xf2, 0xae, 0xa2, 0xdb, 0x8b, 0xbd, 0xc9, 0xb1, 0xde, + 0xcb, 0x09, 0xfa, 0x0a, 0xe0, 0xc6, 0xcc, 0x59, 0x5f, 0x60, 0x93, 0xd4, 0x19, 0x38, 0x9b, 0x2e, + 0xc6, 0xba, 0xaf, 0xb0, 0x76, 0x51, 0x3d, 0x0b, 0x16, 0x99, 0x39, 0xd2, 0x53, 0x00, 0x8b, 0xc9, + 0xbb, 0xaa, 0x64, 0xb2, 0x36, 0x6a, 0x99, 0x64, 0x31, 0xe0, 0x63, 0x05, 0xf8, 0x10, 0x3d, 0xf8, + 0x6b, 0x40, 0x72, 0x1c, 0x5f, 0xf3, 0x49, 0xf3, 0xf9, 0xb7, 0x91, 0x09, 0xce, 0x46, 0x26, 0xf8, + 0x35, 0x32, 0xc1, 0xe7, 0xb1, 0x99, 0x3b, 0x1b, 0x9b, 0xb9, 0x1f, 0x63, 0x33, 0xf7, 0xaa, 0xee, + 0x7a, 0xb2, 0x33, 0x68, 0x61, 0x87, 0xf7, 0x48, 0x8f, 0xb5, 0xbd, 0x56, 0x97, 0x3b, 0x13, 0xaf, + 0x9a, 0xc3, 0xfb, 0x8c, 0xbc, 0x9b, 0x5a, 0xca, 0xa3, 0x80, 0x89, 0xd6, 0x9a, 0xfa, 0x73, 0xdf, + 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0xbb, 0xda, 0x99, 0xf8, 0xbb, 0x06, 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 { + // Deals return a list of Deal. + Deals(ctx context.Context, in *QueryDealsRequest, opts ...grpc.CallOption) (*QueryDealsResponse, error) + // Deal returns a Deal. + Deal(ctx context.Context, in *QueryDealRequest, opts ...grpc.CallOption) (*QueryDealResponse, error) + // Certificates returns a list of Certificate. + Certificates(ctx context.Context, in *QueryCertificates, opts ...grpc.CallOption) (*QueryCertificatesResponse, error) + // Certificate returns a Certificate + Certificate(ctx context.Context, in *QueryCertificate, opts ...grpc.CallOption) (*QueryCertificateResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Deals(ctx context.Context, in *QueryDealsRequest, opts ...grpc.CallOption) (*QueryDealsResponse, error) { + out := new(QueryDealsResponse) + err := c.cc.Invoke(ctx, "/panacea.datadeal.v2.Query/Deals", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Deal(ctx context.Context, in *QueryDealRequest, opts ...grpc.CallOption) (*QueryDealResponse, error) { + out := new(QueryDealResponse) + err := c.cc.Invoke(ctx, "/panacea.datadeal.v2.Query/Deal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Certificates(ctx context.Context, in *QueryCertificates, opts ...grpc.CallOption) (*QueryCertificatesResponse, error) { + out := new(QueryCertificatesResponse) + err := c.cc.Invoke(ctx, "/panacea.datadeal.v2.Query/Certificates", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Certificate(ctx context.Context, in *QueryCertificate, opts ...grpc.CallOption) (*QueryCertificateResponse, error) { + out := new(QueryCertificateResponse) + err := c.cc.Invoke(ctx, "/panacea.datadeal.v2.Query/Certificate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Deals return a list of Deal. + Deals(context.Context, *QueryDealsRequest) (*QueryDealsResponse, error) + // Deal returns a Deal. + Deal(context.Context, *QueryDealRequest) (*QueryDealResponse, error) + // Certificates returns a list of Certificate. + Certificates(context.Context, *QueryCertificates) (*QueryCertificatesResponse, error) + // Certificate returns a Certificate + Certificate(context.Context, *QueryCertificate) (*QueryCertificateResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Deals(ctx context.Context, req *QueryDealsRequest) (*QueryDealsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deals not implemented") +} +func (*UnimplementedQueryServer) Deal(ctx context.Context, req *QueryDealRequest) (*QueryDealResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deal not implemented") +} +func (*UnimplementedQueryServer) Certificates(ctx context.Context, req *QueryCertificates) (*QueryCertificatesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Certificates not implemented") +} +func (*UnimplementedQueryServer) Certificate(ctx context.Context, req *QueryCertificate) (*QueryCertificateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Certificate not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Deals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDealsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Deals(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.datadeal.v2.Query/Deals", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Deals(ctx, req.(*QueryDealsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Deal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDealRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Deal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.datadeal.v2.Query/Deal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Deal(ctx, req.(*QueryDealRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Certificates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCertificates) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Certificates(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.datadeal.v2.Query/Certificates", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Certificates(ctx, req.(*QueryCertificates)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Certificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCertificate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Certificate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.datadeal.v2.Query/Certificate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Certificate(ctx, req.(*QueryCertificate)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "panacea.datadeal.v2.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Deals", + Handler: _Query_Deals_Handler, + }, + { + MethodName: "Deal", + Handler: _Query_Deal_Handler, + }, + { + MethodName: "Certificates", + Handler: _Query_Certificates_Handler, + }, + { + MethodName: "Certificate", + Handler: _Query_Certificate_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "panacea/datadeal/v2/query.proto", +} + +func (m *QueryDealsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDealsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDealsRequest) 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 *QueryDealsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDealsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDealsResponse) 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.Deal) > 0 { + for iNdEx := len(m.Deal) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Deal[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 *QueryDealRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDealRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDealRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DealId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.DealId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDealResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDealResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDealResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Deal != nil { + { + size, err := m.Deal.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 *QueryCertificates) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCertificates) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCertificates) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.DealId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.DealId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryCertificatesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCertificatesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCertificatesResponse) 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.Certificates) > 0 { + for iNdEx := len(m.Certificates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Certificates[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 *QueryCertificate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCertificate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCertificate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DataHash) > 0 { + i -= len(m.DataHash) + copy(dAtA[i:], m.DataHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DataHash))) + i-- + dAtA[i] = 0x12 + } + if m.DealId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.DealId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryCertificateResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCertificateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCertificateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Certificate != nil { + { + size, err := m.Certificate.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 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 *QueryDealsRequest) 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 *QueryDealsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Deal) > 0 { + for _, e := range m.Deal { + 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 *QueryDealRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DealId != 0 { + n += 1 + sovQuery(uint64(m.DealId)) + } + return n +} + +func (m *QueryDealResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Deal != nil { + l = m.Deal.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCertificates) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DealId != 0 { + n += 1 + sovQuery(uint64(m.DealId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCertificatesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Certificates) > 0 { + for _, e := range m.Certificates { + 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 *QueryCertificate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DealId != 0 { + n += 1 + sovQuery(uint64(m.DealId)) + } + l = len(m.DataHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCertificateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Certificate != nil { + l = m.Certificate.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryDealsRequest) Unmarshal(dAtA []byte) 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: QueryDealsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDealsRequest: 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 *QueryDealsResponse) Unmarshal(dAtA []byte) 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: QueryDealsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDealsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deal", 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.Deal = append(m.Deal, &Deal{}) + if err := m.Deal[len(m.Deal)-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 *QueryDealRequest) Unmarshal(dAtA []byte) 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: QueryDealRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDealRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DealId", wireType) + } + m.DealId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DealId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDealResponse) Unmarshal(dAtA []byte) 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: QueryDealResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDealResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deal", 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.Deal == nil { + m.Deal = &Deal{} + } + if err := m.Deal.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 *QueryCertificates) Unmarshal(dAtA []byte) 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: QueryCertificates: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCertificates: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DealId", wireType) + } + m.DealId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DealId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCertificatesResponse) Unmarshal(dAtA []byte) 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: QueryCertificatesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCertificatesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Certificates", 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.Certificates = append(m.Certificates, &Certificate{}) + if err := m.Certificates[len(m.Certificates)-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 *QueryCertificate) Unmarshal(dAtA []byte) 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: QueryCertificate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCertificate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DealId", wireType) + } + m.DealId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DealId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataHash", 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.DataHash = 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 *QueryCertificateResponse) Unmarshal(dAtA []byte) 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: QueryCertificateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCertificateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Certificate", 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.Certificate == nil { + m.Certificate = &Certificate{} + } + if err := m.Certificate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/datadeal/types/query.pb.gw.go b/x/datadeal/types/query.pb.gw.go new file mode 100644 index 00000000..601ea23f --- /dev/null +++ b/x/datadeal/types/query.pb.gw.go @@ -0,0 +1,500 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: panacea/datadeal/v2/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +var ( + filter_Query_Deals_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Deals_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDealsRequest + 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_Deals_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Deals(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Deals_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDealsRequest + 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_Deals_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Deals(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Deal_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDealRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["deal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "deal_id") + } + + protoReq.DealId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "deal_id", err) + } + + msg, err := client.Deal(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Deal_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDealRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["deal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "deal_id") + } + + protoReq.DealId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "deal_id", err) + } + + msg, err := server.Deal(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Certificates_0 = &utilities.DoubleArray{Encoding: map[string]int{"deal_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Certificates_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCertificates + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["deal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "deal_id") + } + + protoReq.DealId, err = runtime.Int64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "deal_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Certificates_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Certificates(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Certificates_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCertificates + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["deal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "deal_id") + } + + protoReq.DealId, err = runtime.Int64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "deal_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Certificates_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Certificates(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Certificate_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCertificate + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["deal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "deal_id") + } + + protoReq.DealId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "deal_id", err) + } + + val, ok = pathParams["data_hash"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "data_hash") + } + + protoReq.DataHash, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "data_hash", err) + } + + msg, err := client.Certificate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Certificate_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCertificate + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["deal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "deal_id") + } + + protoReq.DealId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "deal_id", err) + } + + val, ok = pathParams["data_hash"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "data_hash") + } + + protoReq.DataHash, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "data_hash", err) + } + + msg, err := server.Certificate(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Deals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Deals_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Deals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Deal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Deal_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Deal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Certificates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Certificates_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Certificates_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Certificate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Certificate_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Certificate_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_Deals_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_Deals_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_Deals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Deal_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_Deal_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_Deal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Certificates_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_Certificates_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_Certificates_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Certificate_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_Certificate_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_Certificate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Deals_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"panacea", "datadeal", "v2", "deals"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Deal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"panacea", "datadeal", "v2", "deals", "deal_id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Certificates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"panacea", "datadeal", "v2", "deals", "deal_id", "certificates"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Certificate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"panacea", "datadeal", "v2", "deals", "deal_id", "certificates", "data_hash"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_Deals_0 = runtime.ForwardResponseMessage + + forward_Query_Deal_0 = runtime.ForwardResponseMessage + + forward_Query_Certificates_0 = runtime.ForwardResponseMessage + + forward_Query_Certificate_0 = runtime.ForwardResponseMessage +) diff --git a/x/datadeal/types/tx.pb.go b/x/datadeal/types/tx.pb.go new file mode 100644 index 00000000..9ff8999a --- /dev/null +++ b/x/datadeal/types/tx.pb.go @@ -0,0 +1,1433 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: panacea/datadeal/v2/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgCreateDeal defines the Msg/CreateDeal request type. +type MsgCreateDeal struct { + DataSchema []string `protobuf:"bytes,1,rep,name=data_schema,json=dataSchema,proto3" json:"data_schema,omitempty"` + Budget *types.Coin `protobuf:"bytes,2,opt,name=budget,proto3" json:"budget,omitempty"` + MaxNumData uint64 `protobuf:"varint,3,opt,name=max_num_data,json=maxNumData,proto3" json:"max_num_data,omitempty"` + BuyerAddress string `protobuf:"bytes,4,opt,name=buyer_address,json=buyerAddress,proto3" json:"buyer_address,omitempty"` +} + +func (m *MsgCreateDeal) Reset() { *m = MsgCreateDeal{} } +func (m *MsgCreateDeal) String() string { return proto.CompactTextString(m) } +func (*MsgCreateDeal) ProtoMessage() {} +func (*MsgCreateDeal) Descriptor() ([]byte, []int) { + return fileDescriptor_9f03db1b9a7fe946, []int{0} +} +func (m *MsgCreateDeal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateDeal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateDeal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateDeal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateDeal.Merge(m, src) +} +func (m *MsgCreateDeal) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateDeal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateDeal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateDeal proto.InternalMessageInfo + +func (m *MsgCreateDeal) GetDataSchema() []string { + if m != nil { + return m.DataSchema + } + return nil +} + +func (m *MsgCreateDeal) GetBudget() *types.Coin { + if m != nil { + return m.Budget + } + return nil +} + +func (m *MsgCreateDeal) GetMaxNumData() uint64 { + if m != nil { + return m.MaxNumData + } + return 0 +} + +func (m *MsgCreateDeal) GetBuyerAddress() string { + if m != nil { + return m.BuyerAddress + } + return "" +} + +// MsgCreateDealResponse defines the Msg/CreateDeal response type. +type MsgCreateDealResponse struct { + DealId uint64 `protobuf:"varint,1,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` +} + +func (m *MsgCreateDealResponse) Reset() { *m = MsgCreateDealResponse{} } +func (m *MsgCreateDealResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateDealResponse) ProtoMessage() {} +func (*MsgCreateDealResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9f03db1b9a7fe946, []int{1} +} +func (m *MsgCreateDealResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateDealResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateDealResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateDealResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateDealResponse.Merge(m, src) +} +func (m *MsgCreateDealResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateDealResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateDealResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateDealResponse proto.InternalMessageInfo + +func (m *MsgCreateDealResponse) GetDealId() uint64 { + if m != nil { + return m.DealId + } + return 0 +} + +// MsgDeactivateDeal defines the Msg/DeactivateDeal request type. +type MsgDeactivateDeal struct { + DealId uint64 `protobuf:"varint,1,opt,name=deal_id,json=dealId,proto3" json:"deal_id,omitempty"` + RequesterAddress string `protobuf:"bytes,2,opt,name=requester_address,json=requesterAddress,proto3" json:"requester_address,omitempty"` +} + +func (m *MsgDeactivateDeal) Reset() { *m = MsgDeactivateDeal{} } +func (m *MsgDeactivateDeal) String() string { return proto.CompactTextString(m) } +func (*MsgDeactivateDeal) ProtoMessage() {} +func (*MsgDeactivateDeal) Descriptor() ([]byte, []int) { + return fileDescriptor_9f03db1b9a7fe946, []int{2} +} +func (m *MsgDeactivateDeal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeactivateDeal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeactivateDeal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgDeactivateDeal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeactivateDeal.Merge(m, src) +} +func (m *MsgDeactivateDeal) XXX_Size() int { + return m.Size() +} +func (m *MsgDeactivateDeal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeactivateDeal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeactivateDeal proto.InternalMessageInfo + +func (m *MsgDeactivateDeal) GetDealId() uint64 { + if m != nil { + return m.DealId + } + return 0 +} + +func (m *MsgDeactivateDeal) GetRequesterAddress() string { + if m != nil { + return m.RequesterAddress + } + return "" +} + +// MsgDeactivateDealResponse defines the Msg/DeactivateDeal response type. +type MsgDeactivateDealResponse struct { +} + +func (m *MsgDeactivateDealResponse) Reset() { *m = MsgDeactivateDealResponse{} } +func (m *MsgDeactivateDealResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDeactivateDealResponse) ProtoMessage() {} +func (*MsgDeactivateDealResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9f03db1b9a7fe946, []int{3} +} +func (m *MsgDeactivateDealResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeactivateDealResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeactivateDealResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgDeactivateDealResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeactivateDealResponse.Merge(m, src) +} +func (m *MsgDeactivateDealResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDeactivateDealResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeactivateDealResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeactivateDealResponse proto.InternalMessageInfo + +// MsgSubmitConsent defines the Msg/SubmitConsent request type. +type MsgSubmitConsent struct { + Certificate *Certificate `protobuf:"bytes,1,opt,name=certificate,proto3" json:"certificate,omitempty"` +} + +func (m *MsgSubmitConsent) Reset() { *m = MsgSubmitConsent{} } +func (m *MsgSubmitConsent) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitConsent) ProtoMessage() {} +func (*MsgSubmitConsent) Descriptor() ([]byte, []int) { + return fileDescriptor_9f03db1b9a7fe946, []int{4} +} +func (m *MsgSubmitConsent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitConsent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitConsent.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSubmitConsent) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitConsent.Merge(m, src) +} +func (m *MsgSubmitConsent) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitConsent) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitConsent.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitConsent proto.InternalMessageInfo + +func (m *MsgSubmitConsent) GetCertificate() *Certificate { + if m != nil { + return m.Certificate + } + return nil +} + +// MsgSubmitConsentResponse defines the Msg/SubmitConsent response type. +type MsgSubmitConsentResponse struct { +} + +func (m *MsgSubmitConsentResponse) Reset() { *m = MsgSubmitConsentResponse{} } +func (m *MsgSubmitConsentResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitConsentResponse) ProtoMessage() {} +func (*MsgSubmitConsentResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9f03db1b9a7fe946, []int{5} +} +func (m *MsgSubmitConsentResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitConsentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitConsentResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSubmitConsentResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitConsentResponse.Merge(m, src) +} +func (m *MsgSubmitConsentResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitConsentResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitConsentResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitConsentResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreateDeal)(nil), "panacea.datadeal.v2.MsgCreateDeal") + proto.RegisterType((*MsgCreateDealResponse)(nil), "panacea.datadeal.v2.MsgCreateDealResponse") + proto.RegisterType((*MsgDeactivateDeal)(nil), "panacea.datadeal.v2.MsgDeactivateDeal") + proto.RegisterType((*MsgDeactivateDealResponse)(nil), "panacea.datadeal.v2.MsgDeactivateDealResponse") + proto.RegisterType((*MsgSubmitConsent)(nil), "panacea.datadeal.v2.MsgSubmitConsent") + proto.RegisterType((*MsgSubmitConsentResponse)(nil), "panacea.datadeal.v2.MsgSubmitConsentResponse") +} + +func init() { proto.RegisterFile("panacea/datadeal/v2/tx.proto", fileDescriptor_9f03db1b9a7fe946) } + +var fileDescriptor_9f03db1b9a7fe946 = []byte{ + // 498 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xc1, 0x6e, 0xd3, 0x40, + 0x14, 0x8c, 0x93, 0x2a, 0xa8, 0x2f, 0x0d, 0x6a, 0x0d, 0x08, 0xd7, 0x20, 0x63, 0x19, 0x15, 0x45, + 0xa0, 0xee, 0x92, 0xf0, 0x05, 0x34, 0xb9, 0x20, 0x14, 0x0e, 0xae, 0x84, 0x04, 0x42, 0xb2, 0xd6, + 0xeb, 0x87, 0x63, 0x29, 0xf6, 0x06, 0xef, 0x3a, 0x4a, 0xff, 0x82, 0xef, 0xe0, 0xcc, 0x47, 0x70, + 0xec, 0x91, 0x23, 0x4a, 0x7e, 0x04, 0xd9, 0x8e, 0xd3, 0xb8, 0x24, 0xa2, 0x37, 0xfb, 0xcd, 0xbc, + 0x99, 0xd9, 0xb1, 0x17, 0x9e, 0xce, 0x58, 0xc2, 0x38, 0x32, 0x1a, 0x30, 0xc5, 0x02, 0x64, 0x53, + 0x3a, 0x1f, 0x50, 0xb5, 0x20, 0xb3, 0x54, 0x28, 0xa1, 0x3f, 0x58, 0xa3, 0xa4, 0x42, 0xc9, 0x7c, + 0x60, 0x3e, 0x0c, 0x45, 0x28, 0x0a, 0x9c, 0xe6, 0x4f, 0x25, 0xd5, 0xb4, 0xb8, 0x90, 0xb1, 0x90, + 0xd4, 0x67, 0x12, 0xe9, 0xbc, 0xef, 0xa3, 0x62, 0x7d, 0xca, 0x45, 0x94, 0x54, 0xf8, 0x2e, 0xa3, + 0x42, 0xb2, 0xc4, 0xcf, 0x76, 0xe1, 0x1c, 0x53, 0x15, 0x7d, 0x8d, 0x38, 0x53, 0x58, 0xd2, 0x9c, + 0x1f, 0x1a, 0x74, 0xc7, 0x32, 0x1c, 0xa6, 0xc8, 0x14, 0x8e, 0x90, 0x4d, 0xf5, 0x67, 0xd0, 0xc9, + 0x57, 0x3c, 0xc9, 0x27, 0x18, 0x33, 0x43, 0xb3, 0x5b, 0xbd, 0x43, 0x17, 0xf2, 0xd1, 0x65, 0x31, + 0xd1, 0xfb, 0xd0, 0xf6, 0xb3, 0x20, 0x44, 0x65, 0x34, 0x6d, 0xad, 0xd7, 0x19, 0x9c, 0x92, 0x32, + 0x2a, 0xc9, 0xa3, 0x92, 0x75, 0x54, 0x32, 0x14, 0x51, 0xe2, 0xae, 0x89, 0xba, 0x0d, 0x47, 0x31, + 0x5b, 0x78, 0x49, 0x16, 0x7b, 0xb9, 0x90, 0xd1, 0xb2, 0xb5, 0xde, 0x81, 0x0b, 0x31, 0x5b, 0x7c, + 0xc8, 0xe2, 0x11, 0x53, 0x4c, 0x7f, 0x0e, 0x5d, 0x3f, 0xbb, 0xc2, 0xd4, 0x63, 0x41, 0x90, 0xa2, + 0x94, 0xc6, 0x81, 0xad, 0xf5, 0x0e, 0xdd, 0xa3, 0x62, 0xf8, 0xb6, 0x9c, 0x39, 0xaf, 0xe1, 0x51, + 0x2d, 0xab, 0x8b, 0x72, 0x26, 0x12, 0x89, 0xfa, 0x63, 0xb8, 0x97, 0x1f, 0xd1, 0x8b, 0x02, 0x43, + 0x2b, 0xa4, 0xdb, 0xf9, 0xeb, 0xbb, 0xc0, 0xf9, 0x04, 0x27, 0x63, 0x19, 0x8e, 0x90, 0x71, 0x15, + 0xcd, 0xab, 0x13, 0xee, 0x63, 0xeb, 0xaf, 0xe0, 0x24, 0xc5, 0x6f, 0x19, 0x4a, 0xb5, 0x15, 0xa4, + 0x59, 0x04, 0x39, 0xde, 0x00, 0x55, 0x98, 0x27, 0x70, 0xfa, 0x8f, 0x74, 0x15, 0xc8, 0xf9, 0x08, + 0xc7, 0x63, 0x19, 0x5e, 0x66, 0x7e, 0x1c, 0xa9, 0x61, 0x3e, 0x49, 0x94, 0x7e, 0x01, 0x9d, 0xad, + 0xfe, 0x0b, 0xeb, 0xce, 0xc0, 0x26, 0x3b, 0x7e, 0x09, 0x32, 0xbc, 0xe1, 0xb9, 0xdb, 0x4b, 0x8e, + 0x09, 0xc6, 0x6d, 0xdd, 0xca, 0x73, 0xf0, 0xb3, 0x09, 0xad, 0xb1, 0x0c, 0xf5, 0x2f, 0x00, 0x5b, + 0x9f, 0xd3, 0xd9, 0x69, 0x50, 0xab, 0xd1, 0x7c, 0xf9, 0x7f, 0xce, 0xa6, 0xea, 0x09, 0xdc, 0xbf, + 0x55, 0xe7, 0x8b, 0x7d, 0xdb, 0x75, 0x9e, 0x49, 0xee, 0xc6, 0xdb, 0x38, 0x21, 0x74, 0xeb, 0x05, + 0x9e, 0xed, 0x13, 0xa8, 0xd1, 0xcc, 0xf3, 0x3b, 0xd1, 0x2a, 0x9b, 0x8b, 0xf7, 0xbf, 0x96, 0x96, + 0x76, 0xbd, 0xb4, 0xb4, 0x3f, 0x4b, 0x4b, 0xfb, 0xbe, 0xb2, 0x1a, 0xd7, 0x2b, 0xab, 0xf1, 0x7b, + 0x65, 0x35, 0x3e, 0xf7, 0xc3, 0x48, 0x4d, 0x32, 0x9f, 0x70, 0x11, 0xd3, 0x18, 0x83, 0xc8, 0x9f, + 0x0a, 0x4e, 0xd7, 0xda, 0xe7, 0x5c, 0xa4, 0x48, 0x17, 0x37, 0xb7, 0x4b, 0x5d, 0xcd, 0x50, 0xfa, + 0xed, 0xe2, 0x56, 0xbd, 0xf9, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x0c, 0xb3, 0x09, 0x27, 0x07, 0x04, + 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// 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 { + // CreateDeal defines a method for creating a deal. + CreateDeal(ctx context.Context, in *MsgCreateDeal, opts ...grpc.CallOption) (*MsgCreateDealResponse, error) + // DeactivateDeal defines a method for deactivating the deal. + DeactivateDeal(ctx context.Context, in *MsgDeactivateDeal, opts ...grpc.CallOption) (*MsgDeactivateDealResponse, error) + // SubmitConsent defines a method for provider's submit consent + SubmitConsent(ctx context.Context, in *MsgSubmitConsent, opts ...grpc.CallOption) (*MsgSubmitConsentResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateDeal(ctx context.Context, in *MsgCreateDeal, opts ...grpc.CallOption) (*MsgCreateDealResponse, error) { + out := new(MsgCreateDealResponse) + err := c.cc.Invoke(ctx, "/panacea.datadeal.v2.Msg/CreateDeal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DeactivateDeal(ctx context.Context, in *MsgDeactivateDeal, opts ...grpc.CallOption) (*MsgDeactivateDealResponse, error) { + out := new(MsgDeactivateDealResponse) + err := c.cc.Invoke(ctx, "/panacea.datadeal.v2.Msg/DeactivateDeal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SubmitConsent(ctx context.Context, in *MsgSubmitConsent, opts ...grpc.CallOption) (*MsgSubmitConsentResponse, error) { + out := new(MsgSubmitConsentResponse) + err := c.cc.Invoke(ctx, "/panacea.datadeal.v2.Msg/SubmitConsent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // CreateDeal defines a method for creating a deal. + CreateDeal(context.Context, *MsgCreateDeal) (*MsgCreateDealResponse, error) + // DeactivateDeal defines a method for deactivating the deal. + DeactivateDeal(context.Context, *MsgDeactivateDeal) (*MsgDeactivateDealResponse, error) + // SubmitConsent defines a method for provider's submit consent + SubmitConsent(context.Context, *MsgSubmitConsent) (*MsgSubmitConsentResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateDeal(ctx context.Context, req *MsgCreateDeal) (*MsgCreateDealResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDeal not implemented") +} +func (*UnimplementedMsgServer) DeactivateDeal(ctx context.Context, req *MsgDeactivateDeal) (*MsgDeactivateDealResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeactivateDeal not implemented") +} +func (*UnimplementedMsgServer) SubmitConsent(ctx context.Context, req *MsgSubmitConsent) (*MsgSubmitConsentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitConsent not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateDeal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateDeal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateDeal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.datadeal.v2.Msg/CreateDeal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateDeal(ctx, req.(*MsgCreateDeal)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_DeactivateDeal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDeactivateDeal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DeactivateDeal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.datadeal.v2.Msg/DeactivateDeal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DeactivateDeal(ctx, req.(*MsgDeactivateDeal)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SubmitConsent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitConsent) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitConsent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.datadeal.v2.Msg/SubmitConsent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitConsent(ctx, req.(*MsgSubmitConsent)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "panacea.datadeal.v2.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateDeal", + Handler: _Msg_CreateDeal_Handler, + }, + { + MethodName: "DeactivateDeal", + Handler: _Msg_DeactivateDeal_Handler, + }, + { + MethodName: "SubmitConsent", + Handler: _Msg_SubmitConsent_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "panacea/datadeal/v2/tx.proto", +} + +func (m *MsgCreateDeal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateDeal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateDeal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BuyerAddress) > 0 { + i -= len(m.BuyerAddress) + copy(dAtA[i:], m.BuyerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.BuyerAddress))) + i-- + dAtA[i] = 0x22 + } + if m.MaxNumData != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.MaxNumData)) + i-- + dAtA[i] = 0x18 + } + if m.Budget != nil { + { + size, err := m.Budget.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.DataSchema) > 0 { + for iNdEx := len(m.DataSchema) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DataSchema[iNdEx]) + copy(dAtA[i:], m.DataSchema[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.DataSchema[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateDealResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateDealResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateDealResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DealId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.DealId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgDeactivateDeal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgDeactivateDeal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeactivateDeal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RequesterAddress) > 0 { + i -= len(m.RequesterAddress) + copy(dAtA[i:], m.RequesterAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.RequesterAddress))) + i-- + dAtA[i] = 0x12 + } + if m.DealId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.DealId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgDeactivateDealResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgDeactivateDealResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeactivateDealResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgSubmitConsent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSubmitConsent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitConsent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Certificate != nil { + { + size, err := m.Certificate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSubmitConsentResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSubmitConsentResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitConsentResponse) 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 *MsgCreateDeal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DataSchema) > 0 { + for _, s := range m.DataSchema { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if m.Budget != nil { + l = m.Budget.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.MaxNumData != 0 { + n += 1 + sovTx(uint64(m.MaxNumData)) + } + l = len(m.BuyerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateDealResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DealId != 0 { + n += 1 + sovTx(uint64(m.DealId)) + } + return n +} + +func (m *MsgDeactivateDeal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DealId != 0 { + n += 1 + sovTx(uint64(m.DealId)) + } + l = len(m.RequesterAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgDeactivateDealResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSubmitConsent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Certificate != nil { + l = m.Certificate.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSubmitConsentResponse) 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 *MsgCreateDeal) Unmarshal(dAtA []byte) 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: MsgCreateDeal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDeal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataSchema", 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.DataSchema = append(m.DataSchema, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Budget", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Budget == nil { + m.Budget = &types.Coin{} + } + if err := m.Budget.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxNumData", wireType) + } + m.MaxNumData = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxNumData |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuyerAddress", 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.BuyerAddress = 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 *MsgCreateDealResponse) Unmarshal(dAtA []byte) 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: MsgCreateDealResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDealResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DealId", wireType) + } + m.DealId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DealId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDeactivateDeal) Unmarshal(dAtA []byte) 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: MsgDeactivateDeal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeactivateDeal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DealId", wireType) + } + m.DealId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DealId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequesterAddress", 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.RequesterAddress = 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 *MsgDeactivateDealResponse) Unmarshal(dAtA []byte) 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: MsgDeactivateDealResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeactivateDealResponse: 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 *MsgSubmitConsent) Unmarshal(dAtA []byte) 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: MsgSubmitConsent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitConsent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Certificate == nil { + m.Certificate = &Certificate{} + } + if err := m.Certificate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitConsentResponse) Unmarshal(dAtA []byte) 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: MsgSubmitConsentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitConsentResponse: 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/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go new file mode 100644 index 00000000..8956d4de --- /dev/null +++ b/x/oracle/types/genesis.pb.go @@ -0,0 +1,681 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: panacea/oracle/v2/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/protobuf/types/known/timestamppb" + 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 oracle module's genesis state. +type GenesisState struct { + Oracles []Oracle `protobuf:"bytes,1,rep,name=oracles,proto3" json:"oracles"` + OracleRegistrations []OracleRegistration `protobuf:"bytes,2,rep,name=oracle_registrations,json=oracleRegistrations,proto3" json:"oracle_registrations"` +} + +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_321e5b447e46614a, []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) GetOracles() []Oracle { + if m != nil { + return m.Oracles + } + return nil +} + +func (m *GenesisState) GetOracleRegistrations() []OracleRegistration { + if m != nil { + return m.OracleRegistrations + } + return nil +} + +// Params defines the oracle module's params. +type Params struct { + // A base64-encoded oracle public key which is paired with an oracle private key generated in SGX by the first oracle. + // This key is used to encrypt data, so that the data can be decrypted and verified securely only in SGX + OraclePublicKey string `protobuf:"bytes,1,opt,name=oracle_public_key,json=oraclePublicKey,proto3" json:"oracle_public_key,omitempty"` + // A base64-encoded SGX remote report which contains an oracle public key. + // Using this report, anyone can validate that the oracle key pair was generated in SGX. + OraclePubKeyRemoteReport string `protobuf:"bytes,2,opt,name=oracle_pub_key_remote_report,json=oraclePubKeyRemoteReport,proto3" json:"oracle_pub_key_remote_report,omitempty"` + // The unique ID of current version of oracle. + UniqueId string `protobuf:"bytes,3,opt,name=unique_id,json=uniqueId,proto3" json:"unique_id,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_321e5b447e46614a, []int{1} +} +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 (m *Params) GetOraclePublicKey() string { + if m != nil { + return m.OraclePublicKey + } + return "" +} + +func (m *Params) GetOraclePubKeyRemoteReport() string { + if m != nil { + return m.OraclePubKeyRemoteReport + } + return "" +} + +func (m *Params) GetUniqueId() string { + if m != nil { + return m.UniqueId + } + return "" +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "panacea.oracle.v2.GenesisState") + proto.RegisterType((*Params)(nil), "panacea.oracle.v2.Params") +} + +func init() { proto.RegisterFile("panacea/oracle/v2/genesis.proto", fileDescriptor_321e5b447e46614a) } + +var fileDescriptor_321e5b447e46614a = []byte{ + // 357 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xc1, 0x4a, 0xeb, 0x40, + 0x14, 0x86, 0x33, 0xed, 0xa5, 0xf7, 0x76, 0xee, 0x85, 0x4b, 0x63, 0x17, 0xb1, 0x4a, 0x5a, 0x0a, + 0x42, 0x11, 0xcc, 0x40, 0x5d, 0xb9, 0x71, 0xd1, 0x8d, 0x94, 0x2e, 0x2c, 0x71, 0xe7, 0xc2, 0x30, + 0x49, 0x8f, 0x71, 0x30, 0xc9, 0xc4, 0x99, 0x49, 0x31, 0x6f, 0xa1, 0x8f, 0xe1, 0x9b, 0x74, 0xd9, + 0xa5, 0x2b, 0x91, 0xf6, 0x45, 0xa4, 0x33, 0xa9, 0x0a, 0xc5, 0xdd, 0x99, 0xf3, 0x7f, 0xe7, 0xff, + 0x0f, 0x73, 0x70, 0x37, 0xa7, 0x19, 0x8d, 0x80, 0x12, 0x2e, 0x68, 0x94, 0x00, 0x99, 0x0f, 0x49, + 0x0c, 0x19, 0x48, 0x26, 0xbd, 0x5c, 0x70, 0xc5, 0xed, 0x56, 0x05, 0x78, 0x06, 0xf0, 0xe6, 0xc3, + 0x4e, 0x3b, 0xe6, 0x31, 0xd7, 0x2a, 0xd9, 0x54, 0x06, 0xec, 0x74, 0x63, 0xce, 0xe3, 0x04, 0x88, + 0x7e, 0x85, 0xc5, 0x2d, 0x51, 0x2c, 0x05, 0xa9, 0x68, 0x9a, 0x57, 0x80, 0xbb, 0x1b, 0x55, 0x79, + 0x6a, 0xbd, 0xff, 0x82, 0xf0, 0xbf, 0x0b, 0x93, 0x7d, 0xa5, 0xa8, 0x02, 0xfb, 0x0c, 0xff, 0x36, + 0x80, 0x74, 0x50, 0xaf, 0x3e, 0xf8, 0x3b, 0xdc, 0xf7, 0x76, 0x96, 0xf1, 0x2e, 0x75, 0x35, 0xfa, + 0xb5, 0x78, 0xeb, 0x5a, 0xfe, 0x96, 0xb7, 0x6f, 0x70, 0xdb, 0x94, 0x81, 0x80, 0x98, 0x49, 0x25, + 0xa8, 0x62, 0x3c, 0x93, 0x4e, 0x4d, 0xfb, 0x1c, 0xfd, 0xe8, 0xe3, 0x7f, 0xa3, 0x2b, 0xcf, 0x3d, + 0xbe, 0xa3, 0xc8, 0xfe, 0x33, 0xc2, 0x8d, 0x29, 0x15, 0x34, 0x95, 0xf6, 0x31, 0x6e, 0x55, 0x51, + 0x79, 0x11, 0x26, 0x2c, 0x0a, 0xee, 0xa1, 0x74, 0x50, 0x0f, 0x0d, 0x9a, 0xfe, 0x7f, 0x23, 0x4c, + 0x75, 0x7f, 0x02, 0xa5, 0x7d, 0x8e, 0x0f, 0xbf, 0xd8, 0x0d, 0x18, 0x08, 0x48, 0xb9, 0xda, 0x6c, + 0x99, 0x73, 0xa1, 0x9c, 0x9a, 0x1e, 0x73, 0x3e, 0xc7, 0x26, 0x50, 0xfa, 0x1a, 0xf0, 0xb5, 0x6e, + 0x1f, 0xe0, 0x66, 0x91, 0xb1, 0x87, 0x02, 0x02, 0x36, 0x73, 0xea, 0x1a, 0xfe, 0x63, 0x1a, 0xe3, + 0xd9, 0x68, 0xbc, 0x58, 0xb9, 0x68, 0xb9, 0x72, 0xd1, 0xfb, 0xca, 0x45, 0x4f, 0x6b, 0xd7, 0x5a, + 0xae, 0x5d, 0xeb, 0x75, 0xed, 0x5a, 0xd7, 0x24, 0x66, 0xea, 0xae, 0x08, 0xbd, 0x88, 0xa7, 0x24, + 0x85, 0x19, 0x0b, 0x13, 0x1e, 0x91, 0xea, 0x0b, 0x4e, 0x22, 0x2e, 0x80, 0x3c, 0x6e, 0x8f, 0xa2, + 0xca, 0x1c, 0x64, 0xd8, 0xd0, 0x17, 0x39, 0xfd, 0x08, 0x00, 0x00, 0xff, 0xff, 0x90, 0xc1, 0x79, + 0x70, 0x1e, 0x02, 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.OracleRegistrations) > 0 { + for iNdEx := len(m.OracleRegistrations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.OracleRegistrations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Oracles) > 0 { + for iNdEx := len(m.Oracles) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Oracles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.UniqueId) > 0 { + i -= len(m.UniqueId) + copy(dAtA[i:], m.UniqueId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.UniqueId))) + i-- + dAtA[i] = 0x1a + } + if len(m.OraclePubKeyRemoteReport) > 0 { + i -= len(m.OraclePubKeyRemoteReport) + copy(dAtA[i:], m.OraclePubKeyRemoteReport) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.OraclePubKeyRemoteReport))) + i-- + dAtA[i] = 0x12 + } + if len(m.OraclePublicKey) > 0 { + i -= len(m.OraclePublicKey) + copy(dAtA[i:], m.OraclePublicKey) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.OraclePublicKey))) + 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 + if len(m.Oracles) > 0 { + for _, e := range m.Oracles { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.OracleRegistrations) > 0 { + for _, e := range m.OracleRegistrations { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OraclePublicKey) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.OraclePubKeyRemoteReport) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.UniqueId) + if l > 0 { + 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 Oracles", 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.Oracles = append(m.Oracles, Oracle{}) + if err := m.Oracles[len(m.Oracles)-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 OracleRegistrations", 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.OracleRegistrations = append(m.OracleRegistrations, OracleRegistration{}) + if err := m.OracleRegistrations[len(m.OracleRegistrations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *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 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OraclePublicKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OraclePublicKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OraclePubKeyRemoteReport", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OraclePubKeyRemoteReport = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UniqueId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UniqueId = string(dAtA[iNdEx:postIndex]) + 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/oracle/types/oracle.pb.go b/x/oracle/types/oracle.pb.go new file mode 100644 index 00000000..7ed8408a --- /dev/null +++ b/x/oracle/types/oracle.pb.go @@ -0,0 +1,1002 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: panacea/oracle/v2/oracle.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Oracle defines a detail of oracle. +type Oracle struct { + OracleAddress string `protobuf:"bytes,1,opt,name=oracle_address,json=oracleAddress,proto3" json:"oracle_address,omitempty"` + UniqueId string `protobuf:"bytes,2,opt,name=unique_id,json=uniqueId,proto3" json:"unique_id,omitempty"` + Endpoint string `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + OracleCommissionRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=oracle_commission_rate,json=oracleCommissionRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"oracle_commission_rate"` +} + +func (m *Oracle) Reset() { *m = Oracle{} } +func (m *Oracle) String() string { return proto.CompactTextString(m) } +func (*Oracle) ProtoMessage() {} +func (*Oracle) Descriptor() ([]byte, []int) { + return fileDescriptor_35c1a1e2fbbbc7ea, []int{0} +} +func (m *Oracle) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Oracle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Oracle.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Oracle) XXX_Merge(src proto.Message) { + xxx_messageInfo_Oracle.Merge(m, src) +} +func (m *Oracle) XXX_Size() int { + return m.Size() +} +func (m *Oracle) XXX_DiscardUnknown() { + xxx_messageInfo_Oracle.DiscardUnknown(m) +} + +var xxx_messageInfo_Oracle proto.InternalMessageInfo + +func (m *Oracle) GetOracleAddress() string { + if m != nil { + return m.OracleAddress + } + return "" +} + +func (m *Oracle) GetUniqueId() string { + if m != nil { + return m.UniqueId + } + return "" +} + +func (m *Oracle) GetEndpoint() string { + if m != nil { + return m.Endpoint + } + return "" +} + +// OracleRegistration defines the detailed states of the registration of oracle. +type OracleRegistration struct { + UniqueId string `protobuf:"bytes,1,opt,name=unique_id,json=uniqueId,proto3" json:"unique_id,omitempty"` + OracleAddress string `protobuf:"bytes,2,opt,name=oracle_address,json=oracleAddress,proto3" json:"oracle_address,omitempty"` + // Node public key is a pair with a node private key which is generated in SGX by each oracle. + // This key is used to share the oracle private key from other oracles. + NodePubKey []byte `protobuf:"bytes,3,opt,name=node_pub_key,json=nodePubKey,proto3" json:"node_pub_key,omitempty"` + // Anyone can validate that the node key pair is generated in SGX using this node key remote report. + NodePubKeyRemoteReport []byte `protobuf:"bytes,4,opt,name=node_pub_key_remote_report,json=nodePubKeyRemoteReport,proto3" json:"node_pub_key_remote_report,omitempty"` + // The trusted block info is required for light client. + // Other oracle can validate whether the oracle set correct trusted block info. + TrustedBlockHeight int64 `protobuf:"varint,5,opt,name=trusted_block_height,json=trustedBlockHeight,proto3" json:"trusted_block_height,omitempty"` + TrustedBlockHash []byte `protobuf:"bytes,6,opt,name=trusted_block_hash,json=trustedBlockHash,proto3" json:"trusted_block_hash,omitempty"` + Endpoint string `protobuf:"bytes,7,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + OracleCommissionRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=oracle_commission_rate,json=oracleCommissionRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"oracle_commission_rate"` +} + +func (m *OracleRegistration) Reset() { *m = OracleRegistration{} } +func (m *OracleRegistration) String() string { return proto.CompactTextString(m) } +func (*OracleRegistration) ProtoMessage() {} +func (*OracleRegistration) Descriptor() ([]byte, []int) { + return fileDescriptor_35c1a1e2fbbbc7ea, []int{1} +} +func (m *OracleRegistration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleRegistration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleRegistration.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleRegistration) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleRegistration.Merge(m, src) +} +func (m *OracleRegistration) XXX_Size() int { + return m.Size() +} +func (m *OracleRegistration) XXX_DiscardUnknown() { + xxx_messageInfo_OracleRegistration.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleRegistration proto.InternalMessageInfo + +func (m *OracleRegistration) GetUniqueId() string { + if m != nil { + return m.UniqueId + } + return "" +} + +func (m *OracleRegistration) GetOracleAddress() string { + if m != nil { + return m.OracleAddress + } + return "" +} + +func (m *OracleRegistration) GetNodePubKey() []byte { + if m != nil { + return m.NodePubKey + } + return nil +} + +func (m *OracleRegistration) GetNodePubKeyRemoteReport() []byte { + if m != nil { + return m.NodePubKeyRemoteReport + } + return nil +} + +func (m *OracleRegistration) GetTrustedBlockHeight() int64 { + if m != nil { + return m.TrustedBlockHeight + } + return 0 +} + +func (m *OracleRegistration) GetTrustedBlockHash() []byte { + if m != nil { + return m.TrustedBlockHash + } + return nil +} + +func (m *OracleRegistration) GetEndpoint() string { + if m != nil { + return m.Endpoint + } + return "" +} + +func init() { + proto.RegisterType((*Oracle)(nil), "panacea.oracle.v2.Oracle") + proto.RegisterType((*OracleRegistration)(nil), "panacea.oracle.v2.OracleRegistration") +} + +func init() { proto.RegisterFile("panacea/oracle/v2/oracle.proto", fileDescriptor_35c1a1e2fbbbc7ea) } + +var fileDescriptor_35c1a1e2fbbbc7ea = []byte{ + // 424 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0x31, 0x6f, 0xd4, 0x30, + 0x14, 0xc7, 0x2f, 0x3d, 0x38, 0xae, 0xd6, 0x81, 0xc0, 0x3a, 0x55, 0xd1, 0x21, 0xa5, 0xa7, 0x4a, + 0xa0, 0x0e, 0x34, 0x41, 0x65, 0x63, 0xe3, 0x60, 0xa0, 0x62, 0x00, 0x79, 0x64, 0xb1, 0x1c, 0xfb, + 0x29, 0xb1, 0xae, 0xc9, 0x0b, 0xb6, 0x53, 0x71, 0xdf, 0x82, 0x91, 0x8f, 0xd4, 0x09, 0x75, 0x44, + 0x0c, 0x15, 0xba, 0xfb, 0x22, 0x28, 0x76, 0x0a, 0xbd, 0xc2, 0xc0, 0xd0, 0x29, 0xce, 0xff, 0xff, + 0xf3, 0xf3, 0xfb, 0xeb, 0x3d, 0x92, 0x34, 0xa2, 0x16, 0x12, 0x44, 0x86, 0x46, 0xc8, 0x53, 0xc8, + 0xce, 0x8e, 0xfb, 0x53, 0xda, 0x18, 0x74, 0x48, 0x1f, 0xf5, 0x7e, 0xda, 0xab, 0x67, 0xc7, 0xb3, + 0x69, 0x81, 0x05, 0x7a, 0x37, 0xeb, 0x4e, 0x01, 0x3c, 0xf8, 0x16, 0x91, 0xd1, 0x7b, 0xcf, 0xd0, + 0x27, 0xe4, 0x41, 0xa0, 0xb9, 0x50, 0xca, 0x80, 0xb5, 0x71, 0x34, 0x8f, 0x0e, 0x77, 0xd9, 0xfd, + 0xa0, 0xbe, 0x0a, 0x22, 0x7d, 0x4c, 0x76, 0xdb, 0x5a, 0x7f, 0x6a, 0x81, 0x6b, 0x15, 0xef, 0x78, + 0x62, 0x1c, 0x84, 0x13, 0x45, 0x67, 0x64, 0x0c, 0xb5, 0x6a, 0x50, 0xd7, 0x2e, 0x1e, 0x06, 0xef, + 0xea, 0x9f, 0x2a, 0xb2, 0xd7, 0xd7, 0x97, 0x58, 0x55, 0xda, 0x5a, 0x8d, 0x35, 0x37, 0xc2, 0x41, + 0x7c, 0xa7, 0x23, 0x17, 0xe9, 0xf9, 0xe5, 0xfe, 0xe0, 0xc7, 0xe5, 0xfe, 0xd3, 0x42, 0xbb, 0xb2, + 0xcd, 0x53, 0x89, 0x55, 0x26, 0xd1, 0x56, 0x68, 0xfb, 0xcf, 0x91, 0x55, 0xcb, 0xcc, 0xad, 0x1a, + 0xb0, 0xe9, 0x1b, 0x90, 0x6c, 0x1a, 0xaa, 0xbd, 0xfe, 0x5d, 0x8c, 0x09, 0x07, 0x07, 0x5f, 0x87, + 0x84, 0x86, 0x40, 0x0c, 0x0a, 0x6d, 0x9d, 0x11, 0x4e, 0x63, 0xbd, 0xdd, 0x75, 0x74, 0xa3, 0xeb, + 0xbf, 0x93, 0xef, 0xfc, 0x2b, 0xf9, 0x9c, 0x4c, 0x6a, 0x54, 0xc0, 0x9b, 0x36, 0xe7, 0x4b, 0x58, + 0xf9, 0x80, 0x13, 0x46, 0x3a, 0xed, 0x43, 0x9b, 0xbf, 0x83, 0x15, 0x7d, 0x49, 0x66, 0xd7, 0x09, + 0x6e, 0xa0, 0x42, 0x07, 0xdc, 0x40, 0x83, 0xc6, 0xf9, 0x98, 0x13, 0xb6, 0xf7, 0x87, 0x67, 0xde, + 0x66, 0xde, 0xa5, 0xcf, 0xc9, 0xd4, 0x99, 0xd6, 0x3a, 0x50, 0x3c, 0x3f, 0x45, 0xb9, 0xe4, 0x25, + 0xe8, 0xa2, 0x74, 0xf1, 0xdd, 0x79, 0x74, 0x38, 0x64, 0xb4, 0xf7, 0x16, 0x9d, 0xf5, 0xd6, 0x3b, + 0xf4, 0x19, 0xa1, 0x37, 0x6e, 0x08, 0x5b, 0xc6, 0x23, 0xff, 0xca, 0xc3, 0x2d, 0x5e, 0xd8, 0x72, + 0x6b, 0x34, 0xf7, 0xfe, 0x7b, 0x34, 0xe3, 0xdb, 0x1b, 0xcd, 0xe2, 0xe4, 0x7c, 0x9d, 0x44, 0x17, + 0xeb, 0x24, 0xfa, 0xb9, 0x4e, 0xa2, 0x2f, 0x9b, 0x64, 0x70, 0xb1, 0x49, 0x06, 0xdf, 0x37, 0xc9, + 0xe0, 0x63, 0x76, 0xad, 0x6e, 0x05, 0x4a, 0x77, 0x71, 0xb2, 0x7e, 0x85, 0x8f, 0x24, 0x1a, 0xc8, + 0x3e, 0x5f, 0x6d, 0xba, 0x7f, 0x24, 0x1f, 0xf9, 0xed, 0x7d, 0xf1, 0x2b, 0x00, 0x00, 0xff, 0xff, + 0x0a, 0x9b, 0xc2, 0xd2, 0x08, 0x03, 0x00, 0x00, +} + +func (m *Oracle) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Oracle) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Oracle) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.OracleCommissionRate.Size() + i -= size + if _, err := m.OracleCommissionRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintOracle(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Endpoint) > 0 { + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = encodeVarintOracle(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0x1a + } + if len(m.UniqueId) > 0 { + i -= len(m.UniqueId) + copy(dAtA[i:], m.UniqueId) + i = encodeVarintOracle(dAtA, i, uint64(len(m.UniqueId))) + i-- + dAtA[i] = 0x12 + } + if len(m.OracleAddress) > 0 { + i -= len(m.OracleAddress) + copy(dAtA[i:], m.OracleAddress) + i = encodeVarintOracle(dAtA, i, uint64(len(m.OracleAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OracleRegistration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OracleRegistration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleRegistration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.OracleCommissionRate.Size() + i -= size + if _, err := m.OracleCommissionRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintOracle(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + if len(m.Endpoint) > 0 { + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = encodeVarintOracle(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0x3a + } + if len(m.TrustedBlockHash) > 0 { + i -= len(m.TrustedBlockHash) + copy(dAtA[i:], m.TrustedBlockHash) + i = encodeVarintOracle(dAtA, i, uint64(len(m.TrustedBlockHash))) + i-- + dAtA[i] = 0x32 + } + if m.TrustedBlockHeight != 0 { + i = encodeVarintOracle(dAtA, i, uint64(m.TrustedBlockHeight)) + i-- + dAtA[i] = 0x28 + } + if len(m.NodePubKeyRemoteReport) > 0 { + i -= len(m.NodePubKeyRemoteReport) + copy(dAtA[i:], m.NodePubKeyRemoteReport) + i = encodeVarintOracle(dAtA, i, uint64(len(m.NodePubKeyRemoteReport))) + i-- + dAtA[i] = 0x22 + } + if len(m.NodePubKey) > 0 { + i -= len(m.NodePubKey) + copy(dAtA[i:], m.NodePubKey) + i = encodeVarintOracle(dAtA, i, uint64(len(m.NodePubKey))) + i-- + dAtA[i] = 0x1a + } + if len(m.OracleAddress) > 0 { + i -= len(m.OracleAddress) + copy(dAtA[i:], m.OracleAddress) + i = encodeVarintOracle(dAtA, i, uint64(len(m.OracleAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.UniqueId) > 0 { + i -= len(m.UniqueId) + copy(dAtA[i:], m.UniqueId) + i = encodeVarintOracle(dAtA, i, uint64(len(m.UniqueId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintOracle(dAtA []byte, offset int, v uint64) int { + offset -= sovOracle(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Oracle) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OracleAddress) + if l > 0 { + n += 1 + l + sovOracle(uint64(l)) + } + l = len(m.UniqueId) + if l > 0 { + n += 1 + l + sovOracle(uint64(l)) + } + l = len(m.Endpoint) + if l > 0 { + n += 1 + l + sovOracle(uint64(l)) + } + l = m.OracleCommissionRate.Size() + n += 1 + l + sovOracle(uint64(l)) + return n +} + +func (m *OracleRegistration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.UniqueId) + if l > 0 { + n += 1 + l + sovOracle(uint64(l)) + } + l = len(m.OracleAddress) + if l > 0 { + n += 1 + l + sovOracle(uint64(l)) + } + l = len(m.NodePubKey) + if l > 0 { + n += 1 + l + sovOracle(uint64(l)) + } + l = len(m.NodePubKeyRemoteReport) + if l > 0 { + n += 1 + l + sovOracle(uint64(l)) + } + if m.TrustedBlockHeight != 0 { + n += 1 + sovOracle(uint64(m.TrustedBlockHeight)) + } + l = len(m.TrustedBlockHash) + if l > 0 { + n += 1 + l + sovOracle(uint64(l)) + } + l = len(m.Endpoint) + if l > 0 { + n += 1 + l + sovOracle(uint64(l)) + } + l = m.OracleCommissionRate.Size() + n += 1 + l + sovOracle(uint64(l)) + return n +} + +func sovOracle(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozOracle(x uint64) (n int) { + return sovOracle(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Oracle) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Oracle: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Oracle: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + 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 ErrInvalidLengthOracle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OracleAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UniqueId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + 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 ErrInvalidLengthOracle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UniqueId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + 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 ErrInvalidLengthOracle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleCommissionRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + 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 ErrInvalidLengthOracle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OracleCommissionRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOracle(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOracle + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleRegistration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OracleRegistration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OracleRegistration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UniqueId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + 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 ErrInvalidLengthOracle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UniqueId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + 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 ErrInvalidLengthOracle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OracleAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodePubKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthOracle + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodePubKey = append(m.NodePubKey[:0], dAtA[iNdEx:postIndex]...) + if m.NodePubKey == nil { + m.NodePubKey = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodePubKeyRemoteReport", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthOracle + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodePubKeyRemoteReport = append(m.NodePubKeyRemoteReport[:0], dAtA[iNdEx:postIndex]...) + if m.NodePubKeyRemoteReport == nil { + m.NodePubKeyRemoteReport = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TrustedBlockHeight", wireType) + } + m.TrustedBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TrustedBlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrustedBlockHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthOracle + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TrustedBlockHash = append(m.TrustedBlockHash[:0], dAtA[iNdEx:postIndex]...) + if m.TrustedBlockHash == nil { + m.TrustedBlockHash = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + 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 ErrInvalidLengthOracle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleCommissionRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + 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 ErrInvalidLengthOracle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OracleCommissionRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOracle(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOracle + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipOracle(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, ErrIntOverflowOracle + } + 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, ErrIntOverflowOracle + } + 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, ErrIntOverflowOracle + } + 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, ErrInvalidLengthOracle + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupOracle + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthOracle + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthOracle = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowOracle = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupOracle = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go new file mode 100644 index 00000000..7b66881a --- /dev/null +++ b/x/oracle/types/query.pb.go @@ -0,0 +1,2316 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: panacea/oracle/v2/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/timestamppb" + 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 + +// QueryOraclesRequest is the request type for the Query/Oracles RPC method. +type QueryOraclesRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryOraclesRequest) Reset() { *m = QueryOraclesRequest{} } +func (m *QueryOraclesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOraclesRequest) ProtoMessage() {} +func (*QueryOraclesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_79c168e4f9a93eac, []int{0} +} +func (m *QueryOraclesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOraclesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOraclesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOraclesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOraclesRequest.Merge(m, src) +} +func (m *QueryOraclesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOraclesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOraclesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOraclesRequest proto.InternalMessageInfo + +func (m *QueryOraclesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryOracleResponse is the response type for the Query/Oracles RPC method. +type QueryOraclesResponse struct { + Oracles []*Oracle `protobuf:"bytes,1,rep,name=oracles,proto3" json:"oracles,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryOraclesResponse) Reset() { *m = QueryOraclesResponse{} } +func (m *QueryOraclesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryOraclesResponse) ProtoMessage() {} +func (*QueryOraclesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_79c168e4f9a93eac, []int{1} +} +func (m *QueryOraclesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOraclesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOraclesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOraclesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOraclesResponse.Merge(m, src) +} +func (m *QueryOraclesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryOraclesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOraclesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOraclesResponse proto.InternalMessageInfo + +func (m *QueryOraclesResponse) GetOracles() []*Oracle { + if m != nil { + return m.Oracles + } + return nil +} + +func (m *QueryOraclesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryOracleRequest is the request type for the Query/Oracle RPC method. +type QueryOracleRequest struct { + OracleAddress string `protobuf:"bytes,1,opt,name=oracle_address,json=oracleAddress,proto3" json:"oracle_address,omitempty"` +} + +func (m *QueryOracleRequest) Reset() { *m = QueryOracleRequest{} } +func (m *QueryOracleRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOracleRequest) ProtoMessage() {} +func (*QueryOracleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_79c168e4f9a93eac, []int{2} +} +func (m *QueryOracleRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOracleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOracleRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOracleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOracleRequest.Merge(m, src) +} +func (m *QueryOracleRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOracleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOracleRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOracleRequest proto.InternalMessageInfo + +func (m *QueryOracleRequest) GetOracleAddress() string { + if m != nil { + return m.OracleAddress + } + return "" +} + +// QueryOracleResponse is the response type for the Query/Oracle RPC method. +type QueryOracleResponse struct { + Oracle *Oracle `protobuf:"bytes,1,opt,name=oracle,proto3" json:"oracle,omitempty"` +} + +func (m *QueryOracleResponse) Reset() { *m = QueryOracleResponse{} } +func (m *QueryOracleResponse) String() string { return proto.CompactTextString(m) } +func (*QueryOracleResponse) ProtoMessage() {} +func (*QueryOracleResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_79c168e4f9a93eac, []int{3} +} +func (m *QueryOracleResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOracleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOracleResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOracleResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOracleResponse.Merge(m, src) +} +func (m *QueryOracleResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryOracleResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOracleResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOracleResponse proto.InternalMessageInfo + +func (m *QueryOracleResponse) GetOracle() *Oracle { + if m != nil { + return m.Oracle + } + return nil +} + +// QueryOracleRegistrationsRequest is the request type for the Query/OracleRegistrations RPC method. +type QueryOracleRegistrationsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryOracleRegistrationsRequest) Reset() { *m = QueryOracleRegistrationsRequest{} } +func (m *QueryOracleRegistrationsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOracleRegistrationsRequest) ProtoMessage() {} +func (*QueryOracleRegistrationsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_79c168e4f9a93eac, []int{4} +} +func (m *QueryOracleRegistrationsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOracleRegistrationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOracleRegistrationsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOracleRegistrationsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOracleRegistrationsRequest.Merge(m, src) +} +func (m *QueryOracleRegistrationsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOracleRegistrationsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOracleRegistrationsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOracleRegistrationsRequest proto.InternalMessageInfo + +func (m *QueryOracleRegistrationsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryOracleRegistrationsResponse is the response type for the Query/OracleRegistrations RPC method. +type QueryOracleRegistrationsResponse struct { + OracleRegistrations []*OracleRegistration `protobuf:"bytes,1,rep,name=oracle_registrations,json=oracleRegistrations,proto3" json:"oracle_registrations,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryOracleRegistrationsResponse) Reset() { *m = QueryOracleRegistrationsResponse{} } +func (m *QueryOracleRegistrationsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryOracleRegistrationsResponse) ProtoMessage() {} +func (*QueryOracleRegistrationsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_79c168e4f9a93eac, []int{5} +} +func (m *QueryOracleRegistrationsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOracleRegistrationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOracleRegistrationsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOracleRegistrationsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOracleRegistrationsResponse.Merge(m, src) +} +func (m *QueryOracleRegistrationsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryOracleRegistrationsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOracleRegistrationsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOracleRegistrationsResponse proto.InternalMessageInfo + +func (m *QueryOracleRegistrationsResponse) GetOracleRegistrations() []*OracleRegistration { + if m != nil { + return m.OracleRegistrations + } + return nil +} + +func (m *QueryOracleRegistrationsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryOracleRegistrationRequest is the request type for the Query/OracleRegistration RPC method. +type QueryOracleRegistrationRequest struct { + UniqueId string `protobuf:"bytes,1,opt,name=unique_id,json=uniqueId,proto3" json:"unique_id,omitempty"` + OracleAddress string `protobuf:"bytes,2,opt,name=oracle_address,json=oracleAddress,proto3" json:"oracle_address,omitempty"` +} + +func (m *QueryOracleRegistrationRequest) Reset() { *m = QueryOracleRegistrationRequest{} } +func (m *QueryOracleRegistrationRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOracleRegistrationRequest) ProtoMessage() {} +func (*QueryOracleRegistrationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_79c168e4f9a93eac, []int{6} +} +func (m *QueryOracleRegistrationRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOracleRegistrationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOracleRegistrationRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOracleRegistrationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOracleRegistrationRequest.Merge(m, src) +} +func (m *QueryOracleRegistrationRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOracleRegistrationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOracleRegistrationRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOracleRegistrationRequest proto.InternalMessageInfo + +func (m *QueryOracleRegistrationRequest) GetUniqueId() string { + if m != nil { + return m.UniqueId + } + return "" +} + +func (m *QueryOracleRegistrationRequest) GetOracleAddress() string { + if m != nil { + return m.OracleAddress + } + return "" +} + +// QueryOracleRegistrationResponse is the response type for the Query/OracleRegistration RPC method. +type QueryOracleRegistrationResponse struct { + OracleRegistration *OracleRegistration `protobuf:"bytes,1,opt,name=oracle_registration,json=oracleRegistration,proto3" json:"oracle_registration,omitempty"` +} + +func (m *QueryOracleRegistrationResponse) Reset() { *m = QueryOracleRegistrationResponse{} } +func (m *QueryOracleRegistrationResponse) String() string { return proto.CompactTextString(m) } +func (*QueryOracleRegistrationResponse) ProtoMessage() {} +func (*QueryOracleRegistrationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_79c168e4f9a93eac, []int{7} +} +func (m *QueryOracleRegistrationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOracleRegistrationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOracleRegistrationResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOracleRegistrationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOracleRegistrationResponse.Merge(m, src) +} +func (m *QueryOracleRegistrationResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryOracleRegistrationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOracleRegistrationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOracleRegistrationResponse proto.InternalMessageInfo + +func (m *QueryOracleRegistrationResponse) GetOracleRegistration() *OracleRegistration { + if m != nil { + return m.OracleRegistration + } + return nil +} + +// QueryOracleParamsRequest is the request type for the Query/OracleParams RPC method. +type QueryOracleParamsRequest struct { +} + +func (m *QueryOracleParamsRequest) Reset() { *m = QueryOracleParamsRequest{} } +func (m *QueryOracleParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOracleParamsRequest) ProtoMessage() {} +func (*QueryOracleParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_79c168e4f9a93eac, []int{8} +} +func (m *QueryOracleParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOracleParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOracleParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOracleParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOracleParamsRequest.Merge(m, src) +} +func (m *QueryOracleParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOracleParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOracleParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOracleParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is the response type for the Query/OracleParams RPC method. +type QueryParamsResponse struct { + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +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_79c168e4f9a93eac, []int{9} +} +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 nil +} + +func init() { + proto.RegisterType((*QueryOraclesRequest)(nil), "panacea.oracle.v2.QueryOraclesRequest") + proto.RegisterType((*QueryOraclesResponse)(nil), "panacea.oracle.v2.QueryOraclesResponse") + proto.RegisterType((*QueryOracleRequest)(nil), "panacea.oracle.v2.QueryOracleRequest") + proto.RegisterType((*QueryOracleResponse)(nil), "panacea.oracle.v2.QueryOracleResponse") + proto.RegisterType((*QueryOracleRegistrationsRequest)(nil), "panacea.oracle.v2.QueryOracleRegistrationsRequest") + proto.RegisterType((*QueryOracleRegistrationsResponse)(nil), "panacea.oracle.v2.QueryOracleRegistrationsResponse") + proto.RegisterType((*QueryOracleRegistrationRequest)(nil), "panacea.oracle.v2.QueryOracleRegistrationRequest") + proto.RegisterType((*QueryOracleRegistrationResponse)(nil), "panacea.oracle.v2.QueryOracleRegistrationResponse") + proto.RegisterType((*QueryOracleParamsRequest)(nil), "panacea.oracle.v2.QueryOracleParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "panacea.oracle.v2.QueryParamsResponse") +} + +func init() { proto.RegisterFile("panacea/oracle/v2/query.proto", fileDescriptor_79c168e4f9a93eac) } + +var fileDescriptor_79c168e4f9a93eac = []byte{ + // 672 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x4d, 0x6b, 0xd4, 0x4e, + 0x1c, 0xc7, 0x3b, 0xfd, 0xf3, 0xdf, 0xda, 0x29, 0x0a, 0xce, 0xf6, 0xd0, 0xa6, 0x35, 0xad, 0x81, + 0x76, 0xab, 0xa5, 0x19, 0x36, 0x7b, 0xf4, 0xa4, 0x48, 0xb5, 0x20, 0x58, 0xf7, 0x20, 0x22, 0x48, + 0x99, 0x24, 0x63, 0x0c, 0x6c, 0x32, 0xd9, 0x4c, 0xb2, 0xb8, 0x94, 0x8a, 0x78, 0xf6, 0x20, 0x28, + 0xf8, 0x32, 0x7c, 0x15, 0x82, 0xde, 0x0a, 0x5e, 0x3c, 0xca, 0xae, 0x2f, 0x44, 0x76, 0x66, 0xb2, + 0xdd, 0x90, 0x64, 0x77, 0x0b, 0xbd, 0xb5, 0xf3, 0x7b, 0xf8, 0x7e, 0x7e, 0x4f, 0x59, 0x78, 0x2b, + 0x22, 0x21, 0x71, 0x28, 0xc1, 0x2c, 0x26, 0x4e, 0x87, 0xe2, 0x9e, 0x85, 0xbb, 0x29, 0x8d, 0xfb, + 0x66, 0x14, 0xb3, 0x84, 0xa1, 0x9b, 0xca, 0x6c, 0x4a, 0xb3, 0xd9, 0xb3, 0xb4, 0x55, 0x8f, 0x79, + 0x4c, 0x58, 0xf1, 0xe8, 0x2f, 0xe9, 0xa8, 0x6d, 0x79, 0x8c, 0x79, 0x1d, 0x8a, 0xc5, 0x7f, 0x76, + 0xfa, 0x1a, 0x27, 0x7e, 0x40, 0x79, 0x42, 0x82, 0x48, 0x39, 0xdc, 0x75, 0x18, 0x0f, 0x18, 0xc7, + 0x36, 0xe1, 0x54, 0x4a, 0xe0, 0x5e, 0xd3, 0xa6, 0x09, 0x69, 0xe2, 0x88, 0x78, 0x7e, 0x48, 0x12, + 0x9f, 0x85, 0xca, 0x77, 0x53, 0x25, 0x23, 0x91, 0x8f, 0x49, 0x18, 0xb2, 0x44, 0x18, 0xb9, 0xb2, + 0xea, 0x45, 0x64, 0x45, 0xa7, 0x50, 0x8a, 0x76, 0x8f, 0x86, 0x94, 0xfb, 0x2a, 0x81, 0xf1, 0x0a, + 0xd6, 0x9f, 0x8d, 0x00, 0x9e, 0x0a, 0x3b, 0x6f, 0xd3, 0x6e, 0x4a, 0x79, 0x82, 0x0e, 0x21, 0xbc, + 0x20, 0x59, 0x03, 0xdb, 0x60, 0x6f, 0xc5, 0xda, 0x35, 0x25, 0xb6, 0x39, 0xc2, 0x36, 0x65, 0x67, + 0x14, 0xb6, 0x79, 0x4c, 0x3c, 0xaa, 0x62, 0xdb, 0x13, 0x91, 0xc6, 0x17, 0x00, 0x57, 0xf3, 0xf9, + 0x79, 0xc4, 0x42, 0x4e, 0x51, 0x0b, 0x2e, 0x49, 0x24, 0xbe, 0x06, 0xb6, 0xff, 0xdb, 0x5b, 0xb1, + 0xd6, 0xcd, 0x42, 0x7b, 0x4d, 0x19, 0xd4, 0xce, 0x3c, 0xd1, 0xa3, 0x1c, 0xd5, 0xa2, 0xa0, 0x6a, + 0xcc, 0xa4, 0x92, 0x8a, 0x39, 0xac, 0x7b, 0x10, 0x4d, 0x50, 0x65, 0x45, 0xef, 0xc0, 0x1b, 0x52, + 0xe9, 0x84, 0xb8, 0x6e, 0x4c, 0x39, 0x17, 0x85, 0x2f, 0xb7, 0xaf, 0xcb, 0xd7, 0xfb, 0xf2, 0xd1, + 0x78, 0x9c, 0x6b, 0xd9, 0xb8, 0xa2, 0x26, 0xac, 0x49, 0x3f, 0xd5, 0xae, 0x29, 0x05, 0x29, 0x47, + 0xc3, 0x87, 0x5b, 0xb9, 0x4c, 0x9e, 0xcf, 0x93, 0x58, 0xce, 0xf7, 0xaa, 0x07, 0xf1, 0x1d, 0xc0, + 0xed, 0x6a, 0x2d, 0x55, 0xc2, 0x0b, 0xb8, 0xaa, 0x1a, 0x10, 0x4f, 0xda, 0xd5, 0x84, 0x76, 0xaa, + 0x0b, 0x9a, 0xf0, 0x6e, 0xd7, 0x59, 0x51, 0xe1, 0xea, 0x26, 0xe7, 0x42, 0xbd, 0xa2, 0x8c, 0xac, + 0x63, 0x1b, 0x70, 0x39, 0x0d, 0xfd, 0x6e, 0x4a, 0x4f, 0x7c, 0x57, 0x0d, 0xf0, 0x9a, 0x7c, 0x38, + 0x72, 0x4b, 0x46, 0xbc, 0x58, 0x36, 0xe2, 0x7e, 0xe5, 0x60, 0xc6, 0xbd, 0x7a, 0x0e, 0xeb, 0x25, + 0xbd, 0x52, 0x13, 0x9a, 0xb3, 0x55, 0xa8, 0xd8, 0x2a, 0x43, 0x83, 0x6b, 0x13, 0xd2, 0xc7, 0x24, + 0x26, 0x41, 0xb6, 0x0c, 0xe3, 0xcd, 0xcb, 0x5e, 0x2f, 0x36, 0x2f, 0x12, 0x2f, 0x53, 0x36, 0x4f, + 0x85, 0x28, 0x47, 0xeb, 0x6b, 0x0d, 0xfe, 0x2f, 0x52, 0xa1, 0x77, 0x70, 0x49, 0xdd, 0x26, 0xda, + 0x2d, 0x89, 0x2b, 0xf9, 0x38, 0x68, 0x8d, 0x99, 0x7e, 0x12, 0xcc, 0x30, 0x3e, 0xfc, 0xfa, 0xfb, + 0x79, 0x71, 0x13, 0x69, 0xb8, 0xea, 0x33, 0xc5, 0xd1, 0x47, 0x00, 0x6b, 0x32, 0x0e, 0xed, 0x4c, + 0xcf, 0x9b, 0xc9, 0xef, 0xce, 0x72, 0x53, 0xea, 0x2d, 0xa1, 0x7e, 0x80, 0xf6, 0xab, 0xd5, 0xf1, + 0x69, 0x7e, 0x1b, 0xce, 0xd0, 0x37, 0x00, 0xeb, 0x25, 0x27, 0x82, 0xac, 0x59, 0xa2, 0xc5, 0xdb, + 0xd5, 0x5a, 0x97, 0x8a, 0x51, 0xd4, 0x58, 0x50, 0xdf, 0x41, 0x8d, 0x4a, 0xea, 0xfc, 0x71, 0xa2, + 0x9f, 0x00, 0xa2, 0x62, 0x42, 0xd4, 0x9c, 0x5f, 0x3c, 0xe3, 0xb5, 0x2e, 0x13, 0xa2, 0x70, 0x9f, + 0x08, 0xdc, 0x43, 0xf4, 0x70, 0x4e, 0x5c, 0x7c, 0x3a, 0x3e, 0xce, 0xb3, 0x62, 0xf7, 0xdf, 0x03, + 0x58, 0x93, 0x9b, 0x8a, 0xf6, 0xa7, 0xc3, 0xe4, 0x0e, 0xa3, 0x7a, 0x25, 0xf2, 0x97, 0x62, 0xdc, + 0x16, 0xb4, 0x1b, 0x68, 0xbd, 0x84, 0x56, 0x5e, 0xc6, 0x83, 0xa3, 0x1f, 0x03, 0x1d, 0x9c, 0x0f, + 0x74, 0xf0, 0x67, 0xa0, 0x83, 0x4f, 0x43, 0x7d, 0xe1, 0x7c, 0xa8, 0x2f, 0xfc, 0x1e, 0xea, 0x0b, + 0x2f, 0xb1, 0xe7, 0x27, 0x6f, 0x52, 0xdb, 0x74, 0x58, 0x80, 0x03, 0xea, 0xfa, 0x76, 0x87, 0x39, + 0x59, 0x9e, 0x03, 0x87, 0xc5, 0x14, 0xbf, 0xcd, 0xd2, 0x25, 0xfd, 0x88, 0x72, 0xbb, 0x26, 0x7e, + 0x62, 0x5b, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x85, 0xc2, 0xec, 0x28, 0x58, 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 + +// 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 { + // Oracles returns a list of oracles. + Oracles(ctx context.Context, in *QueryOraclesRequest, opts ...grpc.CallOption) (*QueryOraclesResponse, error) + // Oracle returns a oracle. + Oracle(ctx context.Context, in *QueryOracleRequest, opts ...grpc.CallOption) (*QueryOracleResponse, error) + // OracleRegistrations returns a list of OracleRegistration. + OracleRegistrations(ctx context.Context, in *QueryOracleRegistrationsRequest, opts ...grpc.CallOption) (*QueryOracleRegistrationsResponse, error) + // OracleRegistration returns a OracleRegistration details. + OracleRegistration(ctx context.Context, in *QueryOracleRegistrationRequest, opts ...grpc.CallOption) (*QueryOracleRegistrationResponse, error) + // Params returns params of oracle module. + Params(ctx context.Context, in *QueryOracleParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Oracles(ctx context.Context, in *QueryOraclesRequest, opts ...grpc.CallOption) (*QueryOraclesResponse, error) { + out := new(QueryOraclesResponse) + err := c.cc.Invoke(ctx, "/panacea.oracle.v2.Query/Oracles", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Oracle(ctx context.Context, in *QueryOracleRequest, opts ...grpc.CallOption) (*QueryOracleResponse, error) { + out := new(QueryOracleResponse) + err := c.cc.Invoke(ctx, "/panacea.oracle.v2.Query/Oracle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) OracleRegistrations(ctx context.Context, in *QueryOracleRegistrationsRequest, opts ...grpc.CallOption) (*QueryOracleRegistrationsResponse, error) { + out := new(QueryOracleRegistrationsResponse) + err := c.cc.Invoke(ctx, "/panacea.oracle.v2.Query/OracleRegistrations", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) OracleRegistration(ctx context.Context, in *QueryOracleRegistrationRequest, opts ...grpc.CallOption) (*QueryOracleRegistrationResponse, error) { + out := new(QueryOracleRegistrationResponse) + err := c.cc.Invoke(ctx, "/panacea.oracle.v2.Query/OracleRegistration", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Params(ctx context.Context, in *QueryOracleParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/panacea.oracle.v2.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Oracles returns a list of oracles. + Oracles(context.Context, *QueryOraclesRequest) (*QueryOraclesResponse, error) + // Oracle returns a oracle. + Oracle(context.Context, *QueryOracleRequest) (*QueryOracleResponse, error) + // OracleRegistrations returns a list of OracleRegistration. + OracleRegistrations(context.Context, *QueryOracleRegistrationsRequest) (*QueryOracleRegistrationsResponse, error) + // OracleRegistration returns a OracleRegistration details. + OracleRegistration(context.Context, *QueryOracleRegistrationRequest) (*QueryOracleRegistrationResponse, error) + // Params returns params of oracle module. + Params(context.Context, *QueryOracleParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Oracles(ctx context.Context, req *QueryOraclesRequest) (*QueryOraclesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Oracles not implemented") +} +func (*UnimplementedQueryServer) Oracle(ctx context.Context, req *QueryOracleRequest) (*QueryOracleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Oracle not implemented") +} +func (*UnimplementedQueryServer) OracleRegistrations(ctx context.Context, req *QueryOracleRegistrationsRequest) (*QueryOracleRegistrationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OracleRegistrations not implemented") +} +func (*UnimplementedQueryServer) OracleRegistration(ctx context.Context, req *QueryOracleRegistrationRequest) (*QueryOracleRegistrationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OracleRegistration not implemented") +} +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryOracleParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Oracles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOraclesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Oracles(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.oracle.v2.Query/Oracles", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Oracles(ctx, req.(*QueryOraclesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Oracle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOracleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Oracle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.oracle.v2.Query/Oracle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Oracle(ctx, req.(*QueryOracleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_OracleRegistrations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOracleRegistrationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).OracleRegistrations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.oracle.v2.Query/OracleRegistrations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).OracleRegistrations(ctx, req.(*QueryOracleRegistrationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_OracleRegistration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOracleRegistrationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).OracleRegistration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.oracle.v2.Query/OracleRegistration", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).OracleRegistration(ctx, req.(*QueryOracleRegistrationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOracleParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.oracle.v2.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryOracleParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "panacea.oracle.v2.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Oracles", + Handler: _Query_Oracles_Handler, + }, + { + MethodName: "Oracle", + Handler: _Query_Oracle_Handler, + }, + { + MethodName: "OracleRegistrations", + Handler: _Query_OracleRegistrations_Handler, + }, + { + MethodName: "OracleRegistration", + Handler: _Query_OracleRegistration_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "panacea/oracle/v2/query.proto", +} + +func (m *QueryOraclesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOraclesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOraclesRequest) 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 *QueryOraclesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOraclesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOraclesResponse) 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.Oracles) > 0 { + for iNdEx := len(m.Oracles) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Oracles[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 *QueryOracleRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOracleRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOracleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OracleAddress) > 0 { + i -= len(m.OracleAddress) + copy(dAtA[i:], m.OracleAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OracleAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryOracleResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOracleResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOracleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Oracle != nil { + { + size, err := m.Oracle.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 *QueryOracleRegistrationsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOracleRegistrationsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOracleRegistrationsRequest) 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 *QueryOracleRegistrationsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOracleRegistrationsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOracleRegistrationsResponse) 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.OracleRegistrations) > 0 { + for iNdEx := len(m.OracleRegistrations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.OracleRegistrations[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 *QueryOracleRegistrationRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOracleRegistrationRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOracleRegistrationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OracleAddress) > 0 { + i -= len(m.OracleAddress) + copy(dAtA[i:], m.OracleAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OracleAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.UniqueId) > 0 { + i -= len(m.UniqueId) + copy(dAtA[i:], m.UniqueId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.UniqueId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryOracleRegistrationResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOracleRegistrationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOracleRegistrationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.OracleRegistration != nil { + { + size, err := m.OracleRegistration.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 *QueryOracleParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOracleParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOracleParamsRequest) 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 + if m.Params != nil { + { + 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 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 *QueryOraclesRequest) 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 *QueryOraclesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Oracles) > 0 { + for _, e := range m.Oracles { + 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 *QueryOracleRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OracleAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOracleResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Oracle != nil { + l = m.Oracle.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOracleRegistrationsRequest) 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 *QueryOracleRegistrationsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.OracleRegistrations) > 0 { + for _, e := range m.OracleRegistrations { + 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 *QueryOracleRegistrationRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.UniqueId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.OracleAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOracleRegistrationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OracleRegistration != nil { + l = m.OracleRegistration.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOracleParamsRequest) 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 + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryOraclesRequest) Unmarshal(dAtA []byte) 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: QueryOraclesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOraclesRequest: 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 *QueryOraclesResponse) Unmarshal(dAtA []byte) 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: QueryOraclesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOraclesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Oracles", 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.Oracles = append(m.Oracles, &Oracle{}) + if err := m.Oracles[len(m.Oracles)-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 *QueryOracleRequest) Unmarshal(dAtA []byte) 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: QueryOracleRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOracleRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleAddress", 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.OracleAddress = 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 *QueryOracleResponse) Unmarshal(dAtA []byte) 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: QueryOracleResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOracleResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Oracle", 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.Oracle == nil { + m.Oracle = &Oracle{} + } + if err := m.Oracle.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 *QueryOracleRegistrationsRequest) Unmarshal(dAtA []byte) 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: QueryOracleRegistrationsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOracleRegistrationsRequest: 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 *QueryOracleRegistrationsResponse) Unmarshal(dAtA []byte) 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: QueryOracleRegistrationsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOracleRegistrationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleRegistrations", 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.OracleRegistrations = append(m.OracleRegistrations, &OracleRegistration{}) + if err := m.OracleRegistrations[len(m.OracleRegistrations)-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 *QueryOracleRegistrationRequest) Unmarshal(dAtA []byte) 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: QueryOracleRegistrationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOracleRegistrationRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UniqueId", 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.UniqueId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleAddress", 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.OracleAddress = 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 *QueryOracleRegistrationResponse) Unmarshal(dAtA []byte) 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: QueryOracleRegistrationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOracleRegistrationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleRegistration", 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.OracleRegistration == nil { + m.OracleRegistration = &OracleRegistration{} + } + if err := m.OracleRegistration.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 *QueryOracleParamsRequest) Unmarshal(dAtA []byte) 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: QueryOracleParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOracleParamsRequest: 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 m.Params == nil { + m.Params = &Params{} + } + 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 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/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go new file mode 100644 index 00000000..4c4fdfe4 --- /dev/null +++ b/x/oracle/types/query.pb.gw.go @@ -0,0 +1,526 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: panacea/oracle/v2/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +var ( + filter_Query_Oracles_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Oracles_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOraclesRequest + 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_Oracles_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Oracles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Oracles_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOraclesRequest + 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_Oracles_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Oracles(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Oracle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOracleRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["oracle_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "oracle_address") + } + + protoReq.OracleAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "oracle_address", err) + } + + msg, err := client.Oracle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Oracle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOracleRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["oracle_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "oracle_address") + } + + protoReq.OracleAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "oracle_address", err) + } + + msg, err := server.Oracle(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_OracleRegistrations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_OracleRegistrations_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOracleRegistrationsRequest + 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_OracleRegistrations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.OracleRegistrations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_OracleRegistrations_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOracleRegistrationsRequest + 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_OracleRegistrations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.OracleRegistrations(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_OracleRegistration_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOracleRegistrationRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["unique_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "unique_id") + } + + protoReq.UniqueId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "unique_id", err) + } + + val, ok = pathParams["oracle_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "oracle_address") + } + + protoReq.OracleAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "oracle_address", err) + } + + msg, err := client.OracleRegistration(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_OracleRegistration_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOracleRegistrationRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["unique_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "unique_id") + } + + protoReq.UniqueId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "unique_id", err) + } + + val, ok = pathParams["oracle_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "oracle_address") + } + + protoReq.OracleAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "oracle_address", err) + } + + msg, err := server.OracleRegistration(ctx, &protoReq) + return msg, metadata, err + +} + +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 QueryOracleParamsRequest + 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 QueryOracleParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Oracles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Oracles_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Oracles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Oracle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Oracle_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Oracle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_OracleRegistrations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_OracleRegistrations_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_OracleRegistrations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_OracleRegistration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_OracleRegistration_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_OracleRegistration_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + 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.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) + 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()...) + + }) + + 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_Oracles_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_Oracles_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_Oracles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Oracle_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_Oracle_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_Oracle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_OracleRegistrations_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_OracleRegistrations_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_OracleRegistrations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_OracleRegistration_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_OracleRegistration_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_OracleRegistration_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + 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()...) + + }) + + return nil +} + +var ( + pattern_Query_Oracles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"panacea", "oracle", "v2", "oracles"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Oracle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"panacea", "oracle", "v2", "oracles", "oracle_address"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_OracleRegistrations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"panacea", "oracle", "v2", "oracle_registrations"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_OracleRegistration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"panacea", "oracle", "v2", "oracle_registrations", "unique_id", "oracle_address"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"panacea", "oracle", "v2", "params"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_Oracles_0 = runtime.ForwardResponseMessage + + forward_Query_Oracle_0 = runtime.ForwardResponseMessage + + forward_Query_OracleRegistrations_0 = runtime.ForwardResponseMessage + + forward_Query_OracleRegistration_0 = runtime.ForwardResponseMessage + + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go new file mode 100644 index 00000000..6a8fb127 --- /dev/null +++ b/x/oracle/types/tx.pb.go @@ -0,0 +1,1998 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: panacea/oracle/v2/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/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" + _ "google.golang.org/protobuf/types/known/timestamppb" + 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 + +// MsgRegisterOracle defines the Msg/RegisterOracle request type. +type MsgRegisterOracle struct { + UniqueId string `protobuf:"bytes,1,opt,name=unique_id,json=uniqueId,proto3" json:"unique_id,omitempty"` + OracleAddress string `protobuf:"bytes,2,opt,name=oracle_address,json=oracleAddress,proto3" json:"oracle_address,omitempty"` + NodePubKey []byte `protobuf:"bytes,3,opt,name=node_pub_key,json=nodePubKey,proto3" json:"node_pub_key,omitempty"` + NodePubKeyRemoteReport []byte `protobuf:"bytes,4,opt,name=node_pub_key_remote_report,json=nodePubKeyRemoteReport,proto3" json:"node_pub_key_remote_report,omitempty"` + TrustedBlockHeight int64 `protobuf:"varint,5,opt,name=trusted_block_height,json=trustedBlockHeight,proto3" json:"trusted_block_height,omitempty"` + TrustedBlockHash []byte `protobuf:"bytes,6,opt,name=trusted_block_hash,json=trustedBlockHash,proto3" json:"trusted_block_hash,omitempty"` + Endpoint string `protobuf:"bytes,7,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + OracleCommissionRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=oracle_commission_rate,json=oracleCommissionRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"oracle_commission_rate"` +} + +func (m *MsgRegisterOracle) Reset() { *m = MsgRegisterOracle{} } +func (m *MsgRegisterOracle) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterOracle) ProtoMessage() {} +func (*MsgRegisterOracle) Descriptor() ([]byte, []int) { + return fileDescriptor_91b53ec53f5557f6, []int{0} +} +func (m *MsgRegisterOracle) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterOracle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterOracle.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRegisterOracle) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterOracle.Merge(m, src) +} +func (m *MsgRegisterOracle) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterOracle) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterOracle.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterOracle proto.InternalMessageInfo + +func (m *MsgRegisterOracle) GetUniqueId() string { + if m != nil { + return m.UniqueId + } + return "" +} + +func (m *MsgRegisterOracle) GetOracleAddress() string { + if m != nil { + return m.OracleAddress + } + return "" +} + +func (m *MsgRegisterOracle) GetNodePubKey() []byte { + if m != nil { + return m.NodePubKey + } + return nil +} + +func (m *MsgRegisterOracle) GetNodePubKeyRemoteReport() []byte { + if m != nil { + return m.NodePubKeyRemoteReport + } + return nil +} + +func (m *MsgRegisterOracle) GetTrustedBlockHeight() int64 { + if m != nil { + return m.TrustedBlockHeight + } + return 0 +} + +func (m *MsgRegisterOracle) GetTrustedBlockHash() []byte { + if m != nil { + return m.TrustedBlockHash + } + return nil +} + +func (m *MsgRegisterOracle) GetEndpoint() string { + if m != nil { + return m.Endpoint + } + return "" +} + +// MsgRegisterOracleResponse defines the Msg/RegisterOracle response type. +type MsgRegisterOracleResponse struct { +} + +func (m *MsgRegisterOracleResponse) Reset() { *m = MsgRegisterOracleResponse{} } +func (m *MsgRegisterOracleResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterOracleResponse) ProtoMessage() {} +func (*MsgRegisterOracleResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_91b53ec53f5557f6, []int{1} +} +func (m *MsgRegisterOracleResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterOracleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterOracleResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRegisterOracleResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterOracleResponse.Merge(m, src) +} +func (m *MsgRegisterOracleResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterOracleResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterOracleResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterOracleResponse proto.InternalMessageInfo + +// MsgApproveOracleRegistration defines the Msg/ApproveOracleRegistration +type MsgApproveOracleRegistration struct { + ApproveOracleRegistration *ApproveOracleRegistration `protobuf:"bytes,1,opt,name=approve_oracle_registration,json=approveOracleRegistration,proto3" json:"approve_oracle_registration,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *MsgApproveOracleRegistration) Reset() { *m = MsgApproveOracleRegistration{} } +func (m *MsgApproveOracleRegistration) String() string { return proto.CompactTextString(m) } +func (*MsgApproveOracleRegistration) ProtoMessage() {} +func (*MsgApproveOracleRegistration) Descriptor() ([]byte, []int) { + return fileDescriptor_91b53ec53f5557f6, []int{2} +} +func (m *MsgApproveOracleRegistration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgApproveOracleRegistration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgApproveOracleRegistration.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgApproveOracleRegistration) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgApproveOracleRegistration.Merge(m, src) +} +func (m *MsgApproveOracleRegistration) XXX_Size() int { + return m.Size() +} +func (m *MsgApproveOracleRegistration) XXX_DiscardUnknown() { + xxx_messageInfo_MsgApproveOracleRegistration.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgApproveOracleRegistration proto.InternalMessageInfo + +func (m *MsgApproveOracleRegistration) GetApproveOracleRegistration() *ApproveOracleRegistration { + if m != nil { + return m.ApproveOracleRegistration + } + return nil +} + +func (m *MsgApproveOracleRegistration) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +// ApproveOracleRegistration defines for oracle registration approval +type ApproveOracleRegistration struct { + UniqueId string `protobuf:"bytes,1,opt,name=unique_id,json=uniqueId,proto3" json:"unique_id,omitempty"` + TargetOracleAddress string `protobuf:"bytes,2,opt,name=target_oracle_address,json=targetOracleAddress,proto3" json:"target_oracle_address,omitempty"` + EncryptedOraclePrivKey []byte `protobuf:"bytes,3,opt,name=encrypted_oracle_priv_key,json=encryptedOraclePrivKey,proto3" json:"encrypted_oracle_priv_key,omitempty"` +} + +func (m *ApproveOracleRegistration) Reset() { *m = ApproveOracleRegistration{} } +func (m *ApproveOracleRegistration) String() string { return proto.CompactTextString(m) } +func (*ApproveOracleRegistration) ProtoMessage() {} +func (*ApproveOracleRegistration) Descriptor() ([]byte, []int) { + return fileDescriptor_91b53ec53f5557f6, []int{3} +} +func (m *ApproveOracleRegistration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ApproveOracleRegistration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ApproveOracleRegistration.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ApproveOracleRegistration) XXX_Merge(src proto.Message) { + xxx_messageInfo_ApproveOracleRegistration.Merge(m, src) +} +func (m *ApproveOracleRegistration) XXX_Size() int { + return m.Size() +} +func (m *ApproveOracleRegistration) XXX_DiscardUnknown() { + xxx_messageInfo_ApproveOracleRegistration.DiscardUnknown(m) +} + +var xxx_messageInfo_ApproveOracleRegistration proto.InternalMessageInfo + +func (m *ApproveOracleRegistration) GetUniqueId() string { + if m != nil { + return m.UniqueId + } + return "" +} + +func (m *ApproveOracleRegistration) GetTargetOracleAddress() string { + if m != nil { + return m.TargetOracleAddress + } + return "" +} + +func (m *ApproveOracleRegistration) GetEncryptedOraclePrivKey() []byte { + if m != nil { + return m.EncryptedOraclePrivKey + } + return nil +} + +// MsgApproveOracleRegistrationResponse defines the Msg/ApproveOracleRegistration +type MsgApproveOracleRegistrationResponse struct { +} + +func (m *MsgApproveOracleRegistrationResponse) Reset() { *m = MsgApproveOracleRegistrationResponse{} } +func (m *MsgApproveOracleRegistrationResponse) String() string { return proto.CompactTextString(m) } +func (*MsgApproveOracleRegistrationResponse) ProtoMessage() {} +func (*MsgApproveOracleRegistrationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_91b53ec53f5557f6, []int{4} +} +func (m *MsgApproveOracleRegistrationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgApproveOracleRegistrationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgApproveOracleRegistrationResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgApproveOracleRegistrationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgApproveOracleRegistrationResponse.Merge(m, src) +} +func (m *MsgApproveOracleRegistrationResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgApproveOracleRegistrationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgApproveOracleRegistrationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgApproveOracleRegistrationResponse proto.InternalMessageInfo + +// MsgUpdateOracleInfo defines the Msg/UpdateOracleInfo +type MsgUpdateOracleInfo struct { + OracleAddress string `protobuf:"bytes,1,opt,name=oracle_address,json=oracleAddress,proto3" json:"oracle_address,omitempty"` + Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + OracleCommissionRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=oracle_commission_rate,json=oracleCommissionRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"oracle_commission_rate"` +} + +func (m *MsgUpdateOracleInfo) Reset() { *m = MsgUpdateOracleInfo{} } +func (m *MsgUpdateOracleInfo) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateOracleInfo) ProtoMessage() {} +func (*MsgUpdateOracleInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_91b53ec53f5557f6, []int{5} +} +func (m *MsgUpdateOracleInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateOracleInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateOracleInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateOracleInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateOracleInfo.Merge(m, src) +} +func (m *MsgUpdateOracleInfo) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateOracleInfo) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateOracleInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateOracleInfo proto.InternalMessageInfo + +func (m *MsgUpdateOracleInfo) GetOracleAddress() string { + if m != nil { + return m.OracleAddress + } + return "" +} + +func (m *MsgUpdateOracleInfo) GetEndpoint() string { + if m != nil { + return m.Endpoint + } + return "" +} + +// MsgUpdateOracleInfoResponse defines the Msg/UpdateOracleInfo +type MsgUpdateOracleInfoResponse struct { +} + +func (m *MsgUpdateOracleInfoResponse) Reset() { *m = MsgUpdateOracleInfoResponse{} } +func (m *MsgUpdateOracleInfoResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateOracleInfoResponse) ProtoMessage() {} +func (*MsgUpdateOracleInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_91b53ec53f5557f6, []int{6} +} +func (m *MsgUpdateOracleInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateOracleInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateOracleInfoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateOracleInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateOracleInfoResponse.Merge(m, src) +} +func (m *MsgUpdateOracleInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateOracleInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateOracleInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateOracleInfoResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgRegisterOracle)(nil), "panacea.oracle.v2.MsgRegisterOracle") + proto.RegisterType((*MsgRegisterOracleResponse)(nil), "panacea.oracle.v2.MsgRegisterOracleResponse") + proto.RegisterType((*MsgApproveOracleRegistration)(nil), "panacea.oracle.v2.MsgApproveOracleRegistration") + proto.RegisterType((*ApproveOracleRegistration)(nil), "panacea.oracle.v2.ApproveOracleRegistration") + proto.RegisterType((*MsgApproveOracleRegistrationResponse)(nil), "panacea.oracle.v2.MsgApproveOracleRegistrationResponse") + proto.RegisterType((*MsgUpdateOracleInfo)(nil), "panacea.oracle.v2.MsgUpdateOracleInfo") + proto.RegisterType((*MsgUpdateOracleInfoResponse)(nil), "panacea.oracle.v2.MsgUpdateOracleInfoResponse") +} + +func init() { proto.RegisterFile("panacea/oracle/v2/tx.proto", fileDescriptor_91b53ec53f5557f6) } + +var fileDescriptor_91b53ec53f5557f6 = []byte{ + // 716 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x41, 0x4f, 0xdb, 0x48, + 0x14, 0x8e, 0xc9, 0x2e, 0x0b, 0xb3, 0x2c, 0x02, 0xc3, 0x22, 0xc7, 0x61, 0x43, 0x14, 0xb1, 0x08, + 0xad, 0xc0, 0xb3, 0x64, 0x0f, 0xab, 0xdd, 0x1b, 0xb4, 0x87, 0x22, 0x14, 0x81, 0x2c, 0xf5, 0xd2, + 0x8b, 0x35, 0xb6, 0x1f, 0xce, 0x94, 0xd8, 0x33, 0xcc, 0x8c, 0x23, 0xf2, 0x03, 0x7a, 0xef, 0xad, + 0x3f, 0xa1, 0x52, 0x7f, 0x44, 0xcf, 0x1c, 0x39, 0x56, 0x3d, 0xd0, 0x0a, 0xfe, 0x48, 0x95, 0xf1, + 0x24, 0x04, 0x92, 0x20, 0x2a, 0xf5, 0x94, 0xf8, 0x7d, 0xdf, 0xfb, 0xde, 0xf3, 0x7b, 0x9f, 0x1f, + 0x72, 0x39, 0xc9, 0x48, 0x04, 0x04, 0x33, 0x41, 0xa2, 0x0e, 0xe0, 0x6e, 0x13, 0xab, 0x0b, 0x8f, + 0x0b, 0xa6, 0x98, 0xbd, 0x6c, 0x30, 0xaf, 0xc0, 0xbc, 0x6e, 0xd3, 0x5d, 0x4d, 0x58, 0xc2, 0x34, + 0x8a, 0xfb, 0xff, 0x0a, 0xa2, 0xbb, 0x91, 0x30, 0x96, 0x74, 0x00, 0xeb, 0xa7, 0x30, 0x3f, 0xc5, + 0x8a, 0xa6, 0x20, 0x15, 0x49, 0xb9, 0x21, 0xfc, 0x15, 0x31, 0x99, 0x32, 0x89, 0x43, 0x22, 0x01, + 0x9f, 0xe7, 0x20, 0x7a, 0xb8, 0xbb, 0x17, 0x82, 0x22, 0x7b, 0x98, 0x93, 0x84, 0x66, 0x44, 0x51, + 0x96, 0x19, 0xee, 0xba, 0x11, 0x23, 0x9c, 0x62, 0x92, 0x65, 0x4c, 0x69, 0x50, 0x1a, 0xb4, 0x36, + 0xde, 0xaf, 0xe9, 0xce, 0xb4, 0x32, 0x8e, 0x27, 0x90, 0x81, 0xa4, 0x46, 0xa0, 0xf1, 0xae, 0x8c, + 0x96, 0x5b, 0x32, 0xf1, 0x21, 0xa1, 0x52, 0x81, 0x38, 0xd6, 0x34, 0xbb, 0x8a, 0xe6, 0xf3, 0x8c, + 0x9e, 0xe7, 0x10, 0xd0, 0xd8, 0xb1, 0xea, 0xd6, 0xf6, 0xbc, 0x3f, 0x57, 0x04, 0x0e, 0x63, 0xfb, + 0x4f, 0xb4, 0x58, 0xa8, 0x05, 0x24, 0x8e, 0x05, 0x48, 0xe9, 0xcc, 0x68, 0xc6, 0x6f, 0x45, 0x74, + 0xbf, 0x08, 0xda, 0x75, 0xb4, 0x90, 0xb1, 0x18, 0x02, 0x9e, 0x87, 0xc1, 0x19, 0xf4, 0x9c, 0x72, + 0xdd, 0xda, 0x5e, 0xf0, 0x51, 0x3f, 0x76, 0x92, 0x87, 0x47, 0xd0, 0xb3, 0xff, 0x47, 0xee, 0x28, + 0x23, 0x10, 0x90, 0x32, 0x05, 0x81, 0x00, 0xce, 0x84, 0x72, 0x7e, 0xd2, 0xfc, 0xb5, 0x3b, 0xbe, + 0xaf, 0x61, 0x5f, 0xa3, 0xf6, 0xdf, 0x68, 0x55, 0x89, 0x5c, 0x2a, 0x88, 0x83, 0xb0, 0xc3, 0xa2, + 0xb3, 0xa0, 0x0d, 0x34, 0x69, 0x2b, 0xe7, 0xe7, 0xba, 0xb5, 0x5d, 0xf6, 0x6d, 0x83, 0x1d, 0xf4, + 0xa1, 0x17, 0x1a, 0xb1, 0x77, 0x90, 0xfd, 0x20, 0x83, 0xc8, 0xb6, 0x33, 0xab, 0xab, 0x2c, 0xdd, + 0xe3, 0x13, 0xd9, 0xb6, 0x5d, 0x34, 0x07, 0x59, 0xcc, 0x19, 0xcd, 0x94, 0xf3, 0x4b, 0x31, 0x80, + 0xc1, 0xb3, 0x1d, 0xa3, 0x35, 0x33, 0x80, 0x88, 0xa5, 0x29, 0x95, 0x92, 0xb2, 0x2c, 0x10, 0x44, + 0x81, 0x33, 0xd7, 0x67, 0x1e, 0x78, 0x97, 0xd7, 0x1b, 0xa5, 0xcf, 0xd7, 0x1b, 0x5b, 0x09, 0x55, + 0xed, 0x3c, 0xf4, 0x22, 0x96, 0x62, 0xb3, 0xf1, 0xe2, 0x67, 0x57, 0xc6, 0x67, 0x58, 0xf5, 0x38, + 0x48, 0xef, 0x39, 0x44, 0xfe, 0x6a, 0xa1, 0xf6, 0x6c, 0x28, 0xe6, 0x13, 0x05, 0x8d, 0x2a, 0xaa, + 0x8c, 0x2d, 0xc6, 0x07, 0xc9, 0x59, 0x26, 0xa1, 0xf1, 0xc1, 0x42, 0xeb, 0x2d, 0x99, 0xec, 0x73, + 0x2e, 0x58, 0x17, 0x06, 0x60, 0x9f, 0x2a, 0xb4, 0x3f, 0xec, 0x0e, 0xaa, 0x92, 0x02, 0x0c, 0x4c, + 0xaf, 0x62, 0x04, 0xd6, 0x3b, 0xfd, 0xb5, 0xb9, 0xe3, 0x8d, 0x59, 0xda, 0x9b, 0x2a, 0xe9, 0x57, + 0xc8, 0xd4, 0x6a, 0xeb, 0x68, 0x5e, 0xd2, 0x24, 0x23, 0x2a, 0x17, 0xa0, 0xdd, 0xb0, 0xe0, 0xdf, + 0x05, 0x1a, 0xef, 0x2d, 0x54, 0x99, 0xde, 0xe9, 0xa3, 0x5e, 0x6b, 0xa2, 0xdf, 0x15, 0x11, 0x09, + 0xa8, 0x60, 0xa2, 0xe5, 0x56, 0x0a, 0xf0, 0xf8, 0x9e, 0xf1, 0xfe, 0x43, 0x15, 0xc8, 0x22, 0xd1, + 0xe3, 0xfd, 0x55, 0x9b, 0x34, 0x2e, 0x68, 0x77, 0xc4, 0x85, 0x6b, 0x43, 0x42, 0x91, 0x7a, 0x22, + 0x68, 0xf7, 0x08, 0x7a, 0x8d, 0x2d, 0xb4, 0xf9, 0xd8, 0x54, 0x87, 0xe3, 0xff, 0x68, 0xa1, 0x95, + 0x96, 0x4c, 0x5e, 0xf2, 0x98, 0x28, 0xc3, 0x3b, 0xcc, 0x4e, 0xd9, 0x84, 0x4f, 0xc3, 0x9a, 0xf4, + 0x69, 0x8c, 0x9a, 0x6b, 0xe6, 0xc9, 0xe6, 0x2a, 0xff, 0x40, 0x73, 0xfd, 0x81, 0xaa, 0x13, 0xfa, + 0x1f, 0xbc, 0x5f, 0xf3, 0xcb, 0x0c, 0x2a, 0xb7, 0x64, 0x62, 0xc7, 0x68, 0xf1, 0xc1, 0x65, 0xd8, + 0x9c, 0x60, 0x99, 0x31, 0x9b, 0xba, 0x3b, 0x4f, 0x61, 0x0d, 0xaa, 0xd9, 0x6f, 0x1e, 0xf5, 0x07, + 0x9e, 0xac, 0x35, 0x35, 0xc1, 0xfd, 0xf7, 0x3b, 0x13, 0x86, 0x7d, 0xbc, 0x46, 0x4b, 0x63, 0x1b, + 0xdd, 0x9a, 0x2c, 0xf6, 0x90, 0xe7, 0x7a, 0x4f, 0xe3, 0x0d, 0x6a, 0x1d, 0x1c, 0x5e, 0xde, 0xd4, + 0xac, 0xab, 0x9b, 0x9a, 0xf5, 0xf5, 0xa6, 0x66, 0xbd, 0xbd, 0xad, 0x95, 0xae, 0x6e, 0x6b, 0xa5, + 0x4f, 0xb7, 0xb5, 0xd2, 0x2b, 0x3c, 0xb2, 0xd8, 0x14, 0x62, 0xda, 0x3f, 0x56, 0xd8, 0x88, 0xef, + 0x46, 0x4c, 0x00, 0xbe, 0x18, 0x5c, 0x73, 0xbd, 0xe5, 0x70, 0x56, 0x5f, 0xf2, 0x7f, 0xbe, 0x05, + 0x00, 0x00, 0xff, 0xff, 0xe1, 0x73, 0xae, 0x44, 0xbc, 0x06, 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 { + // RegisterOracle defines a method for registration of oracle. + RegisterOracle(ctx context.Context, in *MsgRegisterOracle, opts ...grpc.CallOption) (*MsgRegisterOracleResponse, error) + // ApproveOracleRegistration defines a method to approve oracle registration + ApproveOracleRegistration(ctx context.Context, in *MsgApproveOracleRegistration, opts ...grpc.CallOption) (*MsgApproveOracleRegistrationResponse, error) + // UpgradeOracle defines a method for upgrade of oracle. + UpdateOracleInfo(ctx context.Context, in *MsgUpdateOracleInfo, opts ...grpc.CallOption) (*MsgUpdateOracleInfoResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) RegisterOracle(ctx context.Context, in *MsgRegisterOracle, opts ...grpc.CallOption) (*MsgRegisterOracleResponse, error) { + out := new(MsgRegisterOracleResponse) + err := c.cc.Invoke(ctx, "/panacea.oracle.v2.Msg/RegisterOracle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ApproveOracleRegistration(ctx context.Context, in *MsgApproveOracleRegistration, opts ...grpc.CallOption) (*MsgApproveOracleRegistrationResponse, error) { + out := new(MsgApproveOracleRegistrationResponse) + err := c.cc.Invoke(ctx, "/panacea.oracle.v2.Msg/ApproveOracleRegistration", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateOracleInfo(ctx context.Context, in *MsgUpdateOracleInfo, opts ...grpc.CallOption) (*MsgUpdateOracleInfoResponse, error) { + out := new(MsgUpdateOracleInfoResponse) + err := c.cc.Invoke(ctx, "/panacea.oracle.v2.Msg/UpdateOracleInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // RegisterOracle defines a method for registration of oracle. + RegisterOracle(context.Context, *MsgRegisterOracle) (*MsgRegisterOracleResponse, error) + // ApproveOracleRegistration defines a method to approve oracle registration + ApproveOracleRegistration(context.Context, *MsgApproveOracleRegistration) (*MsgApproveOracleRegistrationResponse, error) + // UpgradeOracle defines a method for upgrade of oracle. + UpdateOracleInfo(context.Context, *MsgUpdateOracleInfo) (*MsgUpdateOracleInfoResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) RegisterOracle(ctx context.Context, req *MsgRegisterOracle) (*MsgRegisterOracleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterOracle not implemented") +} +func (*UnimplementedMsgServer) ApproveOracleRegistration(ctx context.Context, req *MsgApproveOracleRegistration) (*MsgApproveOracleRegistrationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ApproveOracleRegistration not implemented") +} +func (*UnimplementedMsgServer) UpdateOracleInfo(ctx context.Context, req *MsgUpdateOracleInfo) (*MsgUpdateOracleInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateOracleInfo not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_RegisterOracle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRegisterOracle) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RegisterOracle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.oracle.v2.Msg/RegisterOracle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RegisterOracle(ctx, req.(*MsgRegisterOracle)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ApproveOracleRegistration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgApproveOracleRegistration) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ApproveOracleRegistration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.oracle.v2.Msg/ApproveOracleRegistration", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ApproveOracleRegistration(ctx, req.(*MsgApproveOracleRegistration)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateOracleInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateOracleInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateOracleInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/panacea.oracle.v2.Msg/UpdateOracleInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateOracleInfo(ctx, req.(*MsgUpdateOracleInfo)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "panacea.oracle.v2.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RegisterOracle", + Handler: _Msg_RegisterOracle_Handler, + }, + { + MethodName: "ApproveOracleRegistration", + Handler: _Msg_ApproveOracleRegistration_Handler, + }, + { + MethodName: "UpdateOracleInfo", + Handler: _Msg_UpdateOracleInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "panacea/oracle/v2/tx.proto", +} + +func (m *MsgRegisterOracle) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRegisterOracle) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterOracle) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.OracleCommissionRate.Size() + i -= size + if _, err := m.OracleCommissionRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + if len(m.Endpoint) > 0 { + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = encodeVarintTx(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0x3a + } + if len(m.TrustedBlockHash) > 0 { + i -= len(m.TrustedBlockHash) + copy(dAtA[i:], m.TrustedBlockHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.TrustedBlockHash))) + i-- + dAtA[i] = 0x32 + } + if m.TrustedBlockHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TrustedBlockHeight)) + i-- + dAtA[i] = 0x28 + } + if len(m.NodePubKeyRemoteReport) > 0 { + i -= len(m.NodePubKeyRemoteReport) + copy(dAtA[i:], m.NodePubKeyRemoteReport) + i = encodeVarintTx(dAtA, i, uint64(len(m.NodePubKeyRemoteReport))) + i-- + dAtA[i] = 0x22 + } + if len(m.NodePubKey) > 0 { + i -= len(m.NodePubKey) + copy(dAtA[i:], m.NodePubKey) + i = encodeVarintTx(dAtA, i, uint64(len(m.NodePubKey))) + i-- + dAtA[i] = 0x1a + } + if len(m.OracleAddress) > 0 { + i -= len(m.OracleAddress) + copy(dAtA[i:], m.OracleAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OracleAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.UniqueId) > 0 { + i -= len(m.UniqueId) + copy(dAtA[i:], m.UniqueId) + i = encodeVarintTx(dAtA, i, uint64(len(m.UniqueId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterOracleResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRegisterOracleResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterOracleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgApproveOracleRegistration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgApproveOracleRegistration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgApproveOracleRegistration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x12 + } + if m.ApproveOracleRegistration != nil { + { + size, err := m.ApproveOracleRegistration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ApproveOracleRegistration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ApproveOracleRegistration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ApproveOracleRegistration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.EncryptedOraclePrivKey) > 0 { + i -= len(m.EncryptedOraclePrivKey) + copy(dAtA[i:], m.EncryptedOraclePrivKey) + i = encodeVarintTx(dAtA, i, uint64(len(m.EncryptedOraclePrivKey))) + i-- + dAtA[i] = 0x1a + } + if len(m.TargetOracleAddress) > 0 { + i -= len(m.TargetOracleAddress) + copy(dAtA[i:], m.TargetOracleAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.TargetOracleAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.UniqueId) > 0 { + i -= len(m.UniqueId) + copy(dAtA[i:], m.UniqueId) + i = encodeVarintTx(dAtA, i, uint64(len(m.UniqueId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgApproveOracleRegistrationResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgApproveOracleRegistrationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgApproveOracleRegistrationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateOracleInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateOracleInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateOracleInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.OracleCommissionRate.Size() + i -= size + if _, err := m.OracleCommissionRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Endpoint) > 0 { + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = encodeVarintTx(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0x12 + } + if len(m.OracleAddress) > 0 { + i -= len(m.OracleAddress) + copy(dAtA[i:], m.OracleAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OracleAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateOracleInfoResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateOracleInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateOracleInfoResponse) 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 *MsgRegisterOracle) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.UniqueId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.OracleAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.NodePubKey) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.NodePubKeyRemoteReport) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.TrustedBlockHeight != 0 { + n += 1 + sovTx(uint64(m.TrustedBlockHeight)) + } + l = len(m.TrustedBlockHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Endpoint) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.OracleCommissionRate.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgRegisterOracleResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgApproveOracleRegistration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ApproveOracleRegistration != nil { + l = m.ApproveOracleRegistration.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *ApproveOracleRegistration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.UniqueId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.TargetOracleAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.EncryptedOraclePrivKey) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgApproveOracleRegistrationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateOracleInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OracleAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Endpoint) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.OracleCommissionRate.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateOracleInfoResponse) 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 *MsgRegisterOracle) Unmarshal(dAtA []byte) 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: MsgRegisterOracle: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterOracle: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UniqueId", 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.UniqueId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleAddress", 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.OracleAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodePubKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodePubKey = append(m.NodePubKey[:0], dAtA[iNdEx:postIndex]...) + if m.NodePubKey == nil { + m.NodePubKey = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodePubKeyRemoteReport", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodePubKeyRemoteReport = append(m.NodePubKeyRemoteReport[:0], dAtA[iNdEx:postIndex]...) + if m.NodePubKeyRemoteReport == nil { + m.NodePubKeyRemoteReport = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TrustedBlockHeight", wireType) + } + m.TrustedBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TrustedBlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrustedBlockHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TrustedBlockHash = append(m.TrustedBlockHash[:0], dAtA[iNdEx:postIndex]...) + if m.TrustedBlockHash == nil { + m.TrustedBlockHash = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", 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.Endpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleCommissionRate", 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 + } + if err := m.OracleCommissionRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRegisterOracleResponse) Unmarshal(dAtA []byte) 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: MsgRegisterOracleResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterOracleResponse: 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 *MsgApproveOracleRegistration) Unmarshal(dAtA []byte) 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: MsgApproveOracleRegistration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgApproveOracleRegistration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ApproveOracleRegistration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ApproveOracleRegistration == nil { + m.ApproveOracleRegistration = &ApproveOracleRegistration{} + } + if err := m.ApproveOracleRegistration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ApproveOracleRegistration) Unmarshal(dAtA []byte) 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: ApproveOracleRegistration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ApproveOracleRegistration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UniqueId", 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.UniqueId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetOracleAddress", 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.TargetOracleAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EncryptedOraclePrivKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EncryptedOraclePrivKey = append(m.EncryptedOraclePrivKey[:0], dAtA[iNdEx:postIndex]...) + if m.EncryptedOraclePrivKey == nil { + m.EncryptedOraclePrivKey = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgApproveOracleRegistrationResponse) Unmarshal(dAtA []byte) 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: MsgApproveOracleRegistrationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgApproveOracleRegistrationResponse: 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 *MsgUpdateOracleInfo) Unmarshal(dAtA []byte) 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: MsgUpdateOracleInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateOracleInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleAddress", 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.OracleAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", 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.Endpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleCommissionRate", 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 + } + if err := m.OracleCommissionRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateOracleInfoResponse) Unmarshal(dAtA []byte) 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: MsgUpdateOracleInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateOracleInfoResponse: 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") +)