forked from cerc-io/laconicd-deprecated
Compare commits
20 Commits
murali/rec
...
main
Author | SHA1 | Date | |
---|---|---|---|
ed81bba3ed | |||
ae07fc0147 | |||
588c52c0b2 | |||
c407145c31 | |||
8077a7a85a | |||
47d086111d | |||
880367d5df | |||
0adc932400 | |||
d57743bfd5 | |||
20a6828bb5 | |||
976a97234f | |||
072b174c9b | |||
|
a5681191a5 | ||
|
1cdf15595e | ||
|
2cc5df02e0 | ||
|
703f146c5b | ||
|
e2178894ef | ||
|
dca3ccb47c | ||
|
2c883282bc | ||
|
b8d6300e4d |
7
.github/workflows/dependencies.yml
vendored
7
.github/workflows/dependencies.yml
vendored
@ -23,6 +23,7 @@ jobs:
|
|||||||
- name: "Dependency Review"
|
- name: "Dependency Review"
|
||||||
uses: actions/dependency-review-action@v3
|
uses: actions/dependency-review-action@v3
|
||||||
if: env.GIT_DIFF
|
if: env.GIT_DIFF
|
||||||
- name: "Go vulnerability check"
|
# TODO: https://git.vdb.to/cerc-io/laconicd/issues/115
|
||||||
run: make vulncheck
|
# - name: "Go vulnerability check"
|
||||||
if: env.GIT_DIFF
|
# run: make vulncheck
|
||||||
|
# if: env.GIT_DIFF
|
||||||
|
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@ -39,7 +39,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: cachix/install-nix-action@v18
|
- uses: cachix/install-nix-action@v20
|
||||||
- uses: cachix/cachix-action@v12
|
- uses: cachix/cachix-action@v12
|
||||||
with:
|
with:
|
||||||
name: ethermint
|
name: ethermint
|
||||||
|
21
.github/workflows/stale.yml
vendored
21
.github/workflows/stale.yml
vendored
@ -1,21 +0,0 @@
|
|||||||
name: "Close stale issues & pull requests"
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * *"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
stale:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/stale@v6
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
stale-pr-message: "This pull request has been automatically marked as stale because it has not had
|
|
||||||
recent activity. It will be closed in 7 days-before-close if no further activity occurs."
|
|
||||||
stale-issue-message: "This issue is stale because it has been open 45 days with no activity. Remove `Status: Stale` label or comment or this will be closed in 7 days."
|
|
||||||
days-before-stale: 45
|
|
||||||
days-before-close: 7
|
|
||||||
exempt-issue-labels: "Status: Blocked, Type: Bug, pinned, automerge"
|
|
||||||
exempt-pr-labels: "Status: Blocked, Type: Bug, pinned, automerge"
|
|
||||||
stale-pr-label: "Status: Stale"
|
|
||||||
stale-issue-label: "Status: Stale"
|
|
@ -6,14 +6,14 @@ run:
|
|||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
- bodyclose
|
- bodyclose
|
||||||
- depguard
|
# - depguard # 20231120 disable until https://github.com/golangci/golangci-lint/issues/3906 is released
|
||||||
- dogsled
|
- dogsled
|
||||||
- dupl
|
- dupl
|
||||||
- errcheck
|
- errcheck
|
||||||
- goconst
|
- goconst
|
||||||
- gocritic
|
- gocritic
|
||||||
- gofumpt
|
- gofumpt
|
||||||
- revive
|
# - revive # 20231120 overly sensitive unused detection
|
||||||
- gosec
|
- gosec
|
||||||
- gosimple
|
- gosimple
|
||||||
- govet
|
- govet
|
||||||
|
@ -19,6 +19,9 @@ test/
|
|||||||
tests/
|
tests/
|
||||||
*_test.go
|
*_test.go
|
||||||
|
|
||||||
|
# false positive; TODO: https://github.com/cerc-io/laconicd/issues/104
|
||||||
|
testutil/network/network.go
|
||||||
|
|
||||||
# Semgrep rules folder
|
# Semgrep rules folder
|
||||||
.semgrep
|
.semgrep
|
||||||
|
|
||||||
|
2
Makefile
2
Makefile
@ -237,7 +237,7 @@ endif
|
|||||||
|
|
||||||
ifeq (, $(shell which go-bindata))
|
ifeq (, $(shell which go-bindata))
|
||||||
@echo "Installing go-bindata..."
|
@echo "Installing go-bindata..."
|
||||||
@go get github.com/kevinburke/go-bindata/go-bindata
|
@go get github.com/kevinburke/go-bindata/go-bindata@v3
|
||||||
else
|
else
|
||||||
@echo "go-bindata already installed; skipping..."
|
@echo "go-bindata already installed; skipping..."
|
||||||
endif
|
endif
|
||||||
|
5
go.mod
5
go.mod
@ -27,7 +27,7 @@ require (
|
|||||||
github.com/holiman/uint256 v1.2.1
|
github.com/holiman/uint256 v1.2.1
|
||||||
github.com/improbable-eng/grpc-web v0.15.0
|
github.com/improbable-eng/grpc-web v0.15.0
|
||||||
github.com/ipfs/go-cid v0.3.2
|
github.com/ipfs/go-cid v0.3.2
|
||||||
github.com/ipld/go-ipld-prime v0.18.0
|
github.com/ipld/go-ipld-prime v0.19.0
|
||||||
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
|
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
|
||||||
github.com/onsi/ginkgo/v2 v2.5.1
|
github.com/onsi/ginkgo/v2 v2.5.1
|
||||||
github.com/onsi/gomega v1.24.1
|
github.com/onsi/gomega v1.24.1
|
||||||
@ -134,6 +134,7 @@ require (
|
|||||||
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
|
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
|
||||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||||
github.com/jmhodges/levigo v1.0.0 // indirect
|
github.com/jmhodges/levigo v1.0.0 // indirect
|
||||||
|
github.com/kevinburke/go-bindata v3.24.0+incompatible // indirect
|
||||||
github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect
|
github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect
|
||||||
github.com/klauspost/compress v1.15.11 // indirect
|
github.com/klauspost/compress v1.15.11 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
|
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
|
||||||
@ -156,7 +157,7 @@ require (
|
|||||||
github.com/multiformats/go-base32 v0.0.3 // indirect
|
github.com/multiformats/go-base32 v0.0.3 // indirect
|
||||||
github.com/multiformats/go-base36 v0.1.0 // indirect
|
github.com/multiformats/go-base36 v0.1.0 // indirect
|
||||||
github.com/multiformats/go-multibase v0.0.3 // indirect
|
github.com/multiformats/go-multibase v0.0.3 // indirect
|
||||||
github.com/multiformats/go-multihash v0.2.0 // indirect
|
github.com/multiformats/go-multihash v0.2.1 // indirect
|
||||||
github.com/multiformats/go-varint v0.0.6 // indirect
|
github.com/multiformats/go-varint v0.0.6 // indirect
|
||||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||||
github.com/pelletier/go-toml v1.9.5 // indirect
|
github.com/pelletier/go-toml v1.9.5 // indirect
|
||||||
|
16
go.sum
16
go.sum
@ -798,8 +798,8 @@ github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mq
|
|||||||
github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po=
|
github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po=
|
||||||
github.com/ipfs/go-cid v0.3.2 h1:OGgOd+JCFM+y1DjWPmVH+2/4POtpDzwcr7VgnB7mZXc=
|
github.com/ipfs/go-cid v0.3.2 h1:OGgOd+JCFM+y1DjWPmVH+2/4POtpDzwcr7VgnB7mZXc=
|
||||||
github.com/ipfs/go-cid v0.3.2/go.mod h1:gQ8pKqT/sUxGY+tIwy1RPpAojYu7jAyCp5Tz1svoupw=
|
github.com/ipfs/go-cid v0.3.2/go.mod h1:gQ8pKqT/sUxGY+tIwy1RPpAojYu7jAyCp5Tz1svoupw=
|
||||||
github.com/ipld/go-ipld-prime v0.18.0 h1:xUk7NUBSWHEXdjiOu2sLXouFJOMs0yoYzeI5RAqhYQo=
|
github.com/ipld/go-ipld-prime v0.19.0 h1:5axC7rJmPc17Emw6TelxGwnzALk0PdupZ2oj2roDj04=
|
||||||
github.com/ipld/go-ipld-prime v0.18.0/go.mod h1:735yXW548CKrLwVCYXzqx90p5deRJMVVxM9eJ4Qe+qE=
|
github.com/ipld/go-ipld-prime v0.19.0/go.mod h1:Q9j3BaVXwaA3o5JUDNvptDDr/x8+F7FG6XJ8WI3ILg4=
|
||||||
github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
|
github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
|
||||||
github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus=
|
github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus=
|
||||||
github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
|
github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
|
||||||
@ -836,6 +836,12 @@ github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E
|
|||||||
github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0=
|
github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0=
|
||||||
github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU=
|
github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU=
|
||||||
github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU=
|
github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU=
|
||||||
|
github.com/kevinburke/go-bindata v1.1.0 h1:JZ8XIdxtkAszuYkgf17qwQzcU/RgsGSVLSULJdN+5bU=
|
||||||
|
github.com/kevinburke/go-bindata v1.1.0/go.mod h1:UJ72WTOoRKzbz+vwtKgARJwsy+1ZGUukVBUCc197TJo=
|
||||||
|
github.com/kevinburke/go-bindata v3.22.0+incompatible h1:/JmqEhIWQ7GRScV0WjX/0tqBrC5D21ALg0H0U/KZ/ts=
|
||||||
|
github.com/kevinburke/go-bindata v3.22.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM=
|
||||||
|
github.com/kevinburke/go-bindata v3.24.0+incompatible h1:qajFA3D0pH94OTLU4zcCCKCDgR+Zr2cZK/RPJHDdFoY=
|
||||||
|
github.com/kevinburke/go-bindata v3.24.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM=
|
||||||
github.com/kevinmbeaulieu/eq-go v1.0.0/go.mod h1:G3S8ajA56gKBZm4UB9AOyoOS37JO3roToPzKNM8dtdM=
|
github.com/kevinmbeaulieu/eq-go v1.0.0/go.mod h1:G3S8ajA56gKBZm4UB9AOyoOS37JO3roToPzKNM8dtdM=
|
||||||
github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM=
|
github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM=
|
||||||
github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc=
|
github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc=
|
||||||
@ -967,9 +973,9 @@ github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ8
|
|||||||
github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM=
|
github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM=
|
||||||
github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk=
|
github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk=
|
||||||
github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc=
|
github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc=
|
||||||
github.com/multiformats/go-multicodec v0.5.0 h1:EgU6cBe/D7WRwQb1KmnBvU7lrcFGMggZVTPtOW9dDHs=
|
github.com/multiformats/go-multicodec v0.6.0 h1:KhH2kSuCARyuJraYMFxrNO3DqIaYhOdS039kbhgVwpE=
|
||||||
github.com/multiformats/go-multihash v0.2.0 h1:oytJb9ZA1OUW0r0f9ea18GiaPOo4SXyc7p2movyUuo4=
|
github.com/multiformats/go-multihash v0.2.1 h1:aem8ZT0VA2nCHHk7bPJ1BjUbHNciqZC/d16Vve9l108=
|
||||||
github.com/multiformats/go-multihash v0.2.0/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc=
|
github.com/multiformats/go-multihash v0.2.1/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc=
|
||||||
github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY=
|
github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY=
|
||||||
github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
|
github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
|
||||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||||
|
9
init.sh
9
init.sh
@ -10,13 +10,17 @@ LOGLEVEL="info"
|
|||||||
TRACE="--trace"
|
TRACE="--trace"
|
||||||
# TRACE=""
|
# TRACE=""
|
||||||
|
|
||||||
|
if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
|
||||||
# validate dependencies are installed
|
# validate dependencies are installed
|
||||||
command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; }
|
command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; }
|
||||||
|
|
||||||
# remove existing daemon and client
|
# remove existing daemon and client
|
||||||
rm -rf ~/.laconic*
|
rm -rf $HOME/.laconicd/*
|
||||||
|
rm -rf $HOME/.laconic/*
|
||||||
|
|
||||||
|
if [ -n "`which make`" ]; then
|
||||||
make install
|
make install
|
||||||
|
fi
|
||||||
|
|
||||||
laconicd config keyring-backend $KEYRING
|
laconicd config keyring-backend $KEYRING
|
||||||
laconicd config chain-id $CHAINID
|
laconicd config chain-id $CHAINID
|
||||||
@ -109,6 +113,9 @@ laconicd validate-genesis
|
|||||||
if [[ $1 == "pending" ]]; then
|
if [[ $1 == "pending" ]]; then
|
||||||
echo "pending mode is on, please wait for the first block committed."
|
echo "pending mode is on, please wait for the first block committed."
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "Using existing database at $HOME/.laconicd. To replace, run '`basename $0` clean'"
|
||||||
|
fi
|
||||||
|
|
||||||
# Start the node (remove the --pruning=nothing flag if historical queries are not needed)
|
# Start the node (remove the --pruning=nothing flag if historical queries are not needed)
|
||||||
laconicd start --pruning=nothing --evm.tracer=json $TRACE --log_level $LOGLEVEL --minimum-gas-prices=0.0001aphoton --json-rpc.api eth,txpool,personal,net,debug,web3,miner --api.enable --gql-server --gql-playground
|
laconicd start --pruning=nothing --evm.tracer=json $TRACE --log_level $LOGLEVEL --minimum-gas-prices=0.0001aphoton --json-rpc.api eth,txpool,personal,net,debug,web3,miner --api.enable --gql-server --gql-playground
|
||||||
|
@ -5,16 +5,13 @@ import "gogoproto/gogo.proto";
|
|||||||
|
|
||||||
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
|
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
|
||||||
|
|
||||||
message HashReference{
|
message ServiceProviderRegistration {
|
||||||
string ref =1 [(gogoproto.jsontag) = "/"];
|
|
||||||
}
|
|
||||||
|
|
||||||
message ServiceProviderRecord {
|
|
||||||
string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
|
string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
|
||||||
string laconic_id = 2 [(gogoproto.moretags) = "json:\"laconicId\" yaml:\"laconicId\""];
|
string laconic_id = 2 [(gogoproto.moretags) = "json:\"laconicId\" yaml:\"laconicId\""];
|
||||||
X500 x500 = 3 [(gogoproto.moretags) = "json:\"x500\" yaml:\"x500\""];
|
X500 x500 = 3 [(gogoproto.moretags) = "json:\"x500\" yaml:\"x500\""];
|
||||||
string type = 4 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
string type = 4 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
|
}
|
||||||
|
|
||||||
message X500 {
|
message X500 {
|
||||||
string common_name = 1 [(gogoproto.moretags) = "json:\"commonName\" yaml:\"commonName\""];
|
string common_name = 1 [(gogoproto.moretags) = "json:\"commonName\" yaml:\"commonName\""];
|
||||||
@ -24,90 +21,111 @@ message ServiceProviderRecord {
|
|||||||
string state_name = 5 [(gogoproto.moretags) = "json:\"stateName\" yaml:\"stateName\""];
|
string state_name = 5 [(gogoproto.moretags) = "json:\"stateName\" yaml:\"stateName\""];
|
||||||
string country = 6 [(gogoproto.moretags) = "json:\"country\" yaml:\"country\""];
|
string country = 6 [(gogoproto.moretags) = "json:\"country\" yaml:\"country\""];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
message WebsiteRegistrationRecord {
|
message WebsiteRegistrationRecord {
|
||||||
string url = 1 [(gogoproto.moretags) = "json:\"url\" yaml:\"url\""];
|
string url = 1 [(gogoproto.moretags) = "json:\"url\" yaml:\"url\""];
|
||||||
HashReference repo_reference = 2
|
string repo_registration_record_cid = 2
|
||||||
[(gogoproto.moretags) = "json:\"repoReference\" yaml:\"repoReference\""];
|
[(gogoproto.moretags) = "json:\"repoRegistrationRecordCID\" yaml:\"repoRegistrationRecordCID\""];
|
||||||
HashReference build_artifact_ref = 3 [(gogoproto.moretags) = "json:\"buildArtifactRef\" yaml:\"buildArtifactRef\""];
|
string build_artifact_cid = 3 [(gogoproto.moretags) = "json:\"buildArtifactCID\" yaml:\"buildArtifactCID\""];
|
||||||
HashReference tls_cert_ref = 4 [(gogoproto.moretags) = "json:\"tlsCertRef\" yaml:\"tlsCertRef\""];
|
string tls_cert_cid = 4 [(gogoproto.moretags) = "json:\"TLSCertCID\" yaml:\"TLSCertCID\""];
|
||||||
string type = 5 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
string type = 5 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
}
|
}
|
||||||
|
|
||||||
message GitRepository{
|
message ApplicationRecord {
|
||||||
string name =1 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
string repo_reference=2 [(gogoproto.moretags) = "json:\"repo_reference\" yaml:\"repo_reference\""];
|
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
||||||
string description = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
|
string description = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
|
||||||
string version = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
string version = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
string type =5 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
string homepage = 5 [(gogoproto.moretags) = "json:\"homepage\" yaml:\"homepage\""];
|
||||||
|
string license = 6 [(gogoproto.moretags) = "json:\"license\" yaml:\"license\""];
|
||||||
|
string author = 7 [(gogoproto.moretags) = "json:\"author\" yaml:\"author\""];
|
||||||
|
repeated string repository = 8 [(gogoproto.moretags) = "json:\"repository\" yaml:\"repository\""];
|
||||||
|
string repository_ref = 9 [(gogoproto.moretags) = "json:\"repositoryRef\" yaml:\"repositoryRef\""];
|
||||||
|
string app_version = 10 [(gogoproto.moretags) = "json:\"appVersion\" yaml:\"appVersion\""];
|
||||||
|
string app_type = 11 [(gogoproto.moretags) = "json:\"appType\" yaml:\"appType\""];
|
||||||
|
string engines = 12 [(gogoproto.moretags) = "json:\"engines\" yaml:\"engines\""];
|
||||||
|
repeated string os = 13 [(gogoproto.moretags) = "json:\"os\" yaml:\"os\""];
|
||||||
|
repeated string cpu = 14 [(gogoproto.moretags) = "json:\"cpu\" yaml:\"cpu\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
}
|
}
|
||||||
|
|
||||||
message Binary{
|
message ApplicationArtifact {
|
||||||
HashReference hash_reference=1;
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
string targeted_arch=2;
|
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
||||||
string runtime_version=3;
|
string description = 4 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
|
||||||
HashReference repo_reference=4;
|
string version = 5 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
string version=5;
|
string application = 6 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
|
||||||
string type=6;
|
string content_type = 7 [(gogoproto.moretags) = "json:\"contentType\" yaml:\"contentType\""];
|
||||||
|
string os = 8 [(gogoproto.moretags) = "json:\"os\" yaml:\"os\""];
|
||||||
|
string cpu = 9 [(gogoproto.moretags) = "json:\"cpu\" yaml:\"cpu\""];
|
||||||
|
repeated string uri = 10 [(gogoproto.moretags) = "json:\"uri\" yaml:\"uri\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
}
|
}
|
||||||
|
|
||||||
message DockerImage{
|
message DnsRecord {
|
||||||
string image_id=1;
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
HashReference binary_reference=2;
|
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
||||||
HashReference repo_reference=3;
|
string version = 3 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
string version=4;
|
string resource_type = 4 [(gogoproto.moretags) = "json:\"resourceType\" yaml:\"resourceType\""];
|
||||||
string type=5;
|
string value = 5 [(gogoproto.moretags) = "json:\"value\" yaml:\"value\""];
|
||||||
|
string request = 6 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
}
|
}
|
||||||
|
|
||||||
message WatcherRegistrationRecord{
|
message ApplicationDeploymentRequest {
|
||||||
WatcherMetadata metadata =1;
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
HashReference repo_reference=2;
|
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
||||||
WASMBinary wasm=3;
|
string version = 3 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
string version=4;
|
string application = 4 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
|
||||||
string type=5;
|
string dns = 5 [(gogoproto.moretags) = "json:\"dns\" yaml:\"dns\""];
|
||||||
|
string config = 6 [(gogoproto.moretags) = "json:\"config\" yaml:\"config\""];
|
||||||
message WatcherMetadata{
|
string deployment = 7 [(gogoproto.moretags) = "json:\"deployment\" yaml:\"deployment\""];
|
||||||
string version=1;
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
HashReference chain_reference=2;
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
}
|
}
|
||||||
|
|
||||||
message WASMBinary{
|
message ApplicationDeploymentRecord {
|
||||||
HashReference hash_reference=1;
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
WASMBinaryMetadata metadata=2;
|
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
||||||
|
string description = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
|
||||||
|
string version = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
|
string application = 5 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
|
||||||
|
string url = 6 [(gogoproto.moretags) = "json:\"url\" yaml:\"url\""];
|
||||||
|
string dns = 7 [(gogoproto.moretags) = "json:\"dns\" yaml:\"dns\""];
|
||||||
|
string request = 8 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
}
|
}
|
||||||
|
|
||||||
message WASMBinaryMetadata{
|
message ApplicationDeploymentRemovalRequest {
|
||||||
string compiler_version=1;
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
string execution_engine_version=2;
|
string version = 2 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
}
|
string deployment = 3 [(gogoproto.moretags) = "json:\"deployment\" yaml:\"deployment\""];
|
||||||
|
string request = 4 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
}
|
}
|
||||||
|
|
||||||
message ResponderContract{
|
message ApplicationDeploymentRemovalRecord {
|
||||||
HashReference service_provider_ref=1;
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
HashReference auction_ref=2;
|
string version = 2 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
HashReference watcher_ref=3;
|
string deployment = 3 [(gogoproto.moretags) = "json:\"deployment\" yaml:\"deployment\""];
|
||||||
string version=4;
|
string request = 4 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
|
||||||
string type=5;
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
}
|
}
|
||||||
|
|
||||||
message JSPackage{
|
message GeneralRecord {
|
||||||
HashReference repo_reference=1;
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
HashReference js_package_ref=2;
|
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
||||||
string version=3;
|
string description = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
|
||||||
string type=4;
|
string version = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
string name =5;
|
string category = 5 [(gogoproto.moretags) = "json:\"category\" yaml:\"category\""];
|
||||||
}
|
string value = 6 [(gogoproto.moretags) = "json:\"value\" yaml:\"value\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
message ChainRegistrationRecord{
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
string name=1;
|
|
||||||
repeated string ipld_types=2;
|
|
||||||
string type=3;
|
|
||||||
string version=4;
|
|
||||||
string chain_id=5;
|
|
||||||
string network_id=6;
|
|
||||||
HashReference genesis_hash=7;
|
|
||||||
}
|
}
|
@ -10,9 +10,8 @@ laconicd_rest_endpoint=http://laconicd:1317
|
|||||||
laconicd_gql_endpoint=http://laconicd:9473/api
|
laconicd_gql_endpoint=http://laconicd:9473/api
|
||||||
# Run tests
|
# Run tests
|
||||||
docker network inspect sdk_tests_default
|
docker network inspect sdk_tests_default
|
||||||
sleep 30s
|
docker compose logs laconicd
|
||||||
docker logs laconicd
|
docker compose exec laconicd sh -c "curl --retry 10 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api"
|
||||||
docker compose exec laconicd sh -c "curl http://127.0.0.1:9473/api"
|
docker compose exec laconicd sh -c "curl --retry 10 --retry-delay 3 --retry-connrefused http://localhost:9473/api"
|
||||||
docker compose exec laconicd sh -c "curl http://localhost:9473/api"
|
|
||||||
|
|
||||||
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test"
|
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test"
|
||||||
|
337
x/auction/types/tx.pb.gw.go
generated
Normal file
337
x/auction/types/tx.pb.gw.go
generated
Normal file
@ -0,0 +1,337 @@
|
|||||||
|
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||||
|
// source: vulcanize/auction/v1beta1/tx.proto
|
||||||
|
|
||||||
|
/*
|
||||||
|
Package types is a reverse proxy.
|
||||||
|
|
||||||
|
It translates gRPC into RESTful JSON APIs.
|
||||||
|
*/
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/descriptor"
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||||
|
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
"google.golang.org/grpc/codes"
|
||||||
|
"google.golang.org/grpc/grpclog"
|
||||||
|
"google.golang.org/grpc/metadata"
|
||||||
|
"google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Suppress "imported and not used" errors
|
||||||
|
var _ codes.Code
|
||||||
|
var _ io.Reader
|
||||||
|
var _ status.Status
|
||||||
|
var _ = runtime.String
|
||||||
|
var _ = utilities.NewDoubleArray
|
||||||
|
var _ = descriptor.ForMessage
|
||||||
|
var _ = metadata.Join
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_CreateAuction_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_CreateAuction_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgCreateAuction
|
||||||
|
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_Msg_CreateAuction_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.CreateAuction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_CreateAuction_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgCreateAuction
|
||||||
|
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_Msg_CreateAuction_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.CreateAuction(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_CommitBid_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_CommitBid_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgCommitBid
|
||||||
|
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_Msg_CommitBid_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.CommitBid(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_CommitBid_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgCommitBid
|
||||||
|
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_Msg_CommitBid_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.CommitBid(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_RevealBid_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_RevealBid_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgRevealBid
|
||||||
|
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_Msg_RevealBid_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.RevealBid(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_RevealBid_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgRevealBid
|
||||||
|
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_Msg_RevealBid_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.RevealBid(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux".
|
||||||
|
// UnaryRPC :call MsgServer directly.
|
||||||
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead.
|
||||||
|
func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error {
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_CreateAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_CreateAuction_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_CreateAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_CommitBid_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_CommitBid_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_CommitBid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_RevealBid_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_RevealBid_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_RevealBid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but
|
||||||
|
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||||
|
func RegisterMsgHandlerFromEndpoint(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 RegisterMsgHandler(ctx, mux, conn)
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMsgHandler registers the http handlers for service Msg to "mux".
|
||||||
|
// The handlers forward requests to the grpc endpoint over "conn".
|
||||||
|
func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||||
|
return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn))
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMsgHandlerClient registers the http handlers for service Msg
|
||||||
|
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient".
|
||||||
|
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient"
|
||||||
|
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||||
|
// "MsgClient" to call the correct interceptors.
|
||||||
|
func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error {
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_CreateAuction_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_Msg_CreateAuction_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_CreateAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_CommitBid_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_Msg_CommitBid_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_CommitBid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_RevealBid_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_Msg_RevealBid_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_RevealBid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
pattern_Msg_CreateAuction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "auction", "v1beta1", "create_auction"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_CommitBid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "auction", "v1beta1", "commit_bid"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_RevealBid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "auction", "v1beta1", "reveal_bid"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
forward_Msg_CreateAuction_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_CommitBid_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_RevealBid_0 = runtime.ForwardResponseMessage
|
||||||
|
)
|
420
x/bond/types/tx.pb.gw.go
generated
Normal file
420
x/bond/types/tx.pb.gw.go
generated
Normal file
@ -0,0 +1,420 @@
|
|||||||
|
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||||
|
// source: vulcanize/bond/v1beta1/tx.proto
|
||||||
|
|
||||||
|
/*
|
||||||
|
Package types is a reverse proxy.
|
||||||
|
|
||||||
|
It translates gRPC into RESTful JSON APIs.
|
||||||
|
*/
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/descriptor"
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||||
|
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
"google.golang.org/grpc/codes"
|
||||||
|
"google.golang.org/grpc/grpclog"
|
||||||
|
"google.golang.org/grpc/metadata"
|
||||||
|
"google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Suppress "imported and not used" errors
|
||||||
|
var _ codes.Code
|
||||||
|
var _ io.Reader
|
||||||
|
var _ status.Status
|
||||||
|
var _ = runtime.String
|
||||||
|
var _ = utilities.NewDoubleArray
|
||||||
|
var _ = descriptor.ForMessage
|
||||||
|
var _ = metadata.Join
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_CreateBond_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_CreateBond_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgCreateBond
|
||||||
|
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_Msg_CreateBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.CreateBond(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_CreateBond_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgCreateBond
|
||||||
|
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_Msg_CreateBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.CreateBond(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_RefillBond_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_RefillBond_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgRefillBond
|
||||||
|
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_Msg_RefillBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.RefillBond(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_RefillBond_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgRefillBond
|
||||||
|
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_Msg_RefillBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.RefillBond(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_WithdrawBond_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_WithdrawBond_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgWithdrawBond
|
||||||
|
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_Msg_WithdrawBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.WithdrawBond(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_WithdrawBond_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgWithdrawBond
|
||||||
|
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_Msg_WithdrawBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.WithdrawBond(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_CancelBond_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_CancelBond_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgCancelBond
|
||||||
|
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_Msg_CancelBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.CancelBond(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_CancelBond_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgCancelBond
|
||||||
|
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_Msg_CancelBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.CancelBond(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux".
|
||||||
|
// UnaryRPC :call MsgServer directly.
|
||||||
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead.
|
||||||
|
func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error {
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_CreateBond_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_CreateBond_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_CreateBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_RefillBond_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_RefillBond_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_RefillBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_WithdrawBond_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_WithdrawBond_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_WithdrawBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_CancelBond_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_CancelBond_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_CancelBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but
|
||||||
|
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||||
|
func RegisterMsgHandlerFromEndpoint(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 RegisterMsgHandler(ctx, mux, conn)
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMsgHandler registers the http handlers for service Msg to "mux".
|
||||||
|
// The handlers forward requests to the grpc endpoint over "conn".
|
||||||
|
func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||||
|
return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn))
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMsgHandlerClient registers the http handlers for service Msg
|
||||||
|
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient".
|
||||||
|
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient"
|
||||||
|
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||||
|
// "MsgClient" to call the correct interceptors.
|
||||||
|
func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error {
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_CreateBond_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_Msg_CreateBond_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_CreateBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_RefillBond_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_Msg_RefillBond_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_RefillBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_WithdrawBond_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_Msg_WithdrawBond_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_WithdrawBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_CancelBond_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_Msg_CancelBond_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_CancelBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
pattern_Msg_CreateBond_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "bond", "v1beta1", "create_bond"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_RefillBond_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "bond", "v1beta1", "refill_bond"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_WithdrawBond_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "bond", "v1beta1", "withdraw_bond"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_CancelBond_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "bond", "v1beta1", "cancel_bond"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
forward_Msg_CreateBond_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_RefillBond_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_WithdrawBond_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_CancelBond_0 = runtime.ForwardResponseMessage
|
||||||
|
)
|
@ -1,8 +1,7 @@
|
|||||||
record:
|
record:
|
||||||
repo_reference:
|
attr1: value1
|
||||||
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
attr2: value2
|
||||||
js_package_ref:
|
link1:
|
||||||
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
||||||
version: 1.0.0
|
link2:
|
||||||
type: JSPackage
|
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
||||||
name: test-JSPackage
|
|
@ -15,6 +15,8 @@ import (
|
|||||||
tmcli "github.com/tendermint/tendermint/libs/cli"
|
tmcli "github.com/tendermint/tendermint/libs/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const badPath = "/asdasd"
|
||||||
|
|
||||||
func (s *IntegrationTestSuite) TestGRPCQueryParams() {
|
func (s *IntegrationTestSuite) TestGRPCQueryParams() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
@ -28,7 +30,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryParams() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqURL + "/asdasd",
|
reqURL + badPath,
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
@ -75,7 +77,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + "/asdasd",
|
reqUrl + badPath,
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
@ -143,7 +145,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqURL + "/asdasd",
|
reqURL + badPath,
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
@ -195,7 +197,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + "/asdasd",
|
reqUrl + badPath,
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
@ -209,7 +211,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
|
|||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
dir, err := os.Getwd()
|
dir, err := os.Getwd()
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
payloadPath := dir + "/../../helpers/examples/service_provider_example.yml"
|
payloadPath := dir + "/service_provider_example.yml"
|
||||||
args := []string{
|
args := []string{
|
||||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
||||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||||
@ -267,7 +269,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + "/asdasd",
|
reqUrl + badPath,
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
@ -339,7 +341,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + "/asdasd",
|
reqUrl + badPath,
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
@ -353,7 +355,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
|
|||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
dir, err := os.Getwd()
|
dir, err := os.Getwd()
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
payloadPath := dir + "/../../helpers/examples/service_provider_example.yml"
|
payloadPath := dir + "/service_provider_example.yml"
|
||||||
args := []string{
|
args := []string{
|
||||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
||||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||||
@ -409,7 +411,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByID() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqURL + "/asdasd",
|
reqURL + badPath,
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) string {
|
func(bondId string) string {
|
||||||
@ -478,7 +480,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByBondID() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqURL + "/asdasd",
|
reqURL + badPath,
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
@ -532,7 +534,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRegistryModuleBalance() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqURL + "/asdasd",
|
reqURL + badPath,
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
@ -583,7 +585,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryNamesList() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqURL + "/asdasd",
|
reqURL + badPath,
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
@ -626,7 +628,7 @@ func createRecord(bondID string, s *IntegrationTestSuite) {
|
|||||||
|
|
||||||
dir, err := os.Getwd()
|
dir, err := os.Getwd()
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
payloadPath := dir + "/../../helpers/examples/service_provider_example.yml"
|
payloadPath := dir + "/service_provider_example.yml"
|
||||||
args := []string{
|
args := []string{
|
||||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
||||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||||
|
@ -79,7 +79,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() {
|
|||||||
bondID := GetBondID(s)
|
bondID := GetBondID(s)
|
||||||
dir, err := os.Getwd()
|
dir, err := os.Getwd()
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
payloadPath := dir + "/../../helpers/examples/service_provider_example.yml"
|
payloadPath := dir + "/service_provider_example.yml"
|
||||||
args := []string{
|
args := []string{
|
||||||
payloadPath, bondID,
|
payloadPath, bondID,
|
||||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
||||||
|
13
x/registry/client/testutil/service_provider_example.yml
Normal file
13
x/registry/client/testutil/service_provider_example.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
record:
|
||||||
|
type: ServiceProviderRegistration
|
||||||
|
bond_id: madeUpBondID
|
||||||
|
laconic_id: madeUpLaconicID
|
||||||
|
version: 1.0.0
|
||||||
|
x500:
|
||||||
|
common_name: cerc-io
|
||||||
|
organization_unit: xyz
|
||||||
|
organization_name: abc
|
||||||
|
state_name: california
|
||||||
|
country: US
|
||||||
|
locality_name: local
|
@ -198,7 +198,7 @@ func (s *IntegrationTestSuite) TestGetCmdSetRecord() {
|
|||||||
bondID := GetBondID(s)
|
bondID := GetBondID(s)
|
||||||
dir, err := os.Getwd()
|
dir, err := os.Getwd()
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
payloadPath := dir + "/../../helpers/examples/watcher_registration_example.yml"
|
payloadPath := dir + "/service_provider_example.yml"
|
||||||
|
|
||||||
tc.args = append([]string{payloadPath, bondID}, tc.args...)
|
tc.args = append([]string{payloadPath, bondID}, tc.args...)
|
||||||
}
|
}
|
||||||
@ -580,7 +580,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
|||||||
bondID := GetBondID(s)
|
bondID := GetBondID(s)
|
||||||
dir, err := os.Getwd()
|
dir, err := os.Getwd()
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
payloadPath := dir + "/../../helpers/examples/service_provider_example.yml"
|
payloadPath := dir + "/service_provider_example.yml"
|
||||||
|
|
||||||
args := []string{
|
args := []string{
|
||||||
payloadPath, bondID,
|
payloadPath, bondID,
|
||||||
@ -822,7 +822,7 @@ func (s *IntegrationTestSuite) TestGetCmdAssociateBond() {
|
|||||||
bondID := GetBondID(s)
|
bondID := GetBondID(s)
|
||||||
dir, err := os.Getwd()
|
dir, err := os.Getwd()
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
payloadPath := dir + "/../../helpers/examples/service_provider_example.yml"
|
payloadPath := dir + "/service_provider_example.yml"
|
||||||
|
|
||||||
txArgs := []string{
|
txArgs := []string{
|
||||||
payloadPath, bondID,
|
payloadPath, bondID,
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
record:
|
||||||
|
type: WebsiteRegistrationRecord
|
||||||
|
url: https://cerc.io
|
||||||
|
repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
||||||
|
build_artifact_cid: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
||||||
|
tls_cert_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
||||||
|
version: 1.0.0
|
@ -1,9 +0,0 @@
|
|||||||
record:
|
|
||||||
hash_reference:
|
|
||||||
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
|
||||||
targeted_arch: x86_64
|
|
||||||
runtime_version: go 1.18
|
|
||||||
repo_reference:
|
|
||||||
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
|
||||||
version: 1.0.0
|
|
||||||
type: Binary
|
|
@ -1,13 +0,0 @@
|
|||||||
record:
|
|
||||||
name: Laconic
|
|
||||||
ipld_types:
|
|
||||||
- type3
|
|
||||||
- type11
|
|
||||||
- schema2
|
|
||||||
- codec5
|
|
||||||
type: ChainRegistrationRecord
|
|
||||||
version: 0.11.2
|
|
||||||
chain_id: laconic_9000-1
|
|
||||||
network_id: "1392"
|
|
||||||
genesis_hash:
|
|
||||||
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
|
@ -1,8 +0,0 @@
|
|||||||
record:
|
|
||||||
image_id: 77af4d6b9913
|
|
||||||
binary_reference:
|
|
||||||
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
|
||||||
repo_reference:
|
|
||||||
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
|
||||||
version: 1.0.0
|
|
||||||
type: DockerImage
|
|
7
x/registry/helpers/examples/general_record_example.yml
Normal file
7
x/registry/helpers/examples/general_record_example.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
record:
|
||||||
|
type: GeneralRecord
|
||||||
|
name: foo
|
||||||
|
version: 1.0.0
|
||||||
|
tags:
|
||||||
|
- tagA
|
||||||
|
- tagB
|
@ -1,6 +0,0 @@
|
|||||||
record:
|
|
||||||
name: cosmos-sdk
|
|
||||||
repo_reference: https://github.com/cosmos/cosmos-sdk
|
|
||||||
description: This is a description string
|
|
||||||
version: 0.46.7
|
|
||||||
type: GitRepository
|
|
@ -1,9 +0,0 @@
|
|||||||
record:
|
|
||||||
service_provider_ref:
|
|
||||||
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
|
||||||
auction_ref:
|
|
||||||
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
|
||||||
watcher_ref:
|
|
||||||
/: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
|
||||||
version: 1.0.0
|
|
||||||
type: ResponderContract
|
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
record:
|
record:
|
||||||
type: ServiceProviderRecord
|
type: ServiceProviderRegistration
|
||||||
bond_id: madeUpBondID
|
bond_id: madeUpBondID
|
||||||
laconic_id: madeUpLaconicID
|
laconic_id: madeUpLaconicID
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
record:
|
|
||||||
metadata:
|
|
||||||
version: 0.32.0
|
|
||||||
chain_reference:
|
|
||||||
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
|
||||||
repo_reference:
|
|
||||||
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
|
||||||
wasm:
|
|
||||||
hash_reference:
|
|
||||||
/: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
|
||||||
metadata:
|
|
||||||
compiler_version: 1.15.0
|
|
||||||
execution_engine_version: 0.16.1
|
|
||||||
version: 1.0.0
|
|
||||||
type: WatcherRegistrationRecord
|
|
@ -1,10 +1,7 @@
|
|||||||
record:
|
record:
|
||||||
type: WebsiteRegistrationRecord
|
type: WebsiteRegistrationRecord
|
||||||
url: https://cerc.io
|
url: https://cerc.io
|
||||||
repo_reference:
|
repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
||||||
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
build_artifact_cid: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
||||||
build_artifact_ref:
|
tls_cerc_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
||||||
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
|
||||||
tls_cert_ref:
|
|
||||||
/: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
|
||||||
version: 1.0.0
|
version: 1.0.0
|
@ -3,13 +3,12 @@ package keeper_test
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/cerc-io/laconicd/x/registry/client/cli"
|
"github.com/cerc-io/laconicd/x/registry/client/cli"
|
||||||
"github.com/cerc-io/laconicd/x/registry/helpers"
|
"github.com/cerc-io/laconicd/x/registry/helpers"
|
||||||
"github.com/cerc-io/laconicd/x/registry/keeper"
|
"github.com/cerc-io/laconicd/x/registry/keeper"
|
||||||
registrytypes "github.com/cerc-io/laconicd/x/registry/types"
|
registrytypes "github.com/cerc-io/laconicd/x/registry/types"
|
||||||
|
"os"
|
||||||
|
"reflect"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (suite *KeeperTestSuite) TestGrpcQueryParams() {
|
func (suite *KeeperTestSuite) TestGrpcQueryParams() {
|
||||||
@ -38,15 +37,9 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
sr := suite.Require()
|
sr := suite.Require()
|
||||||
var recordId string
|
var recordId string
|
||||||
examples := []string{
|
examples := []string{
|
||||||
"/../helpers/examples/binary_example.yml",
|
|
||||||
"/../helpers/examples/chain_registration_example.yml",
|
|
||||||
"/../helpers/examples/docker_image_example.yml",
|
|
||||||
"/../helpers/examples/git_repo_example.yml",
|
|
||||||
"/../helpers/examples/js_package_example.yml",
|
|
||||||
"/../helpers/examples/responder_contract_example.yml",
|
|
||||||
"/../helpers/examples/service_provider_example.yml",
|
"/../helpers/examples/service_provider_example.yml",
|
||||||
"/../helpers/examples/watcher_registration_example.yml",
|
|
||||||
"/../helpers/examples/website_registration_example.yml",
|
"/../helpers/examples/website_registration_example.yml",
|
||||||
|
"/../helpers/examples/general_record_example.yml",
|
||||||
}
|
}
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
msg string
|
msg string
|
||||||
@ -67,14 +60,14 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
®istrytypes.QueryListRecordsRequest{},
|
®istrytypes.QueryListRecordsRequest{},
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
len(examples),
|
3,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Filter with type",
|
"Filter with type",
|
||||||
®istrytypes.QueryListRecordsRequest{
|
®istrytypes.QueryListRecordsRequest{
|
||||||
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
||||||
{
|
{
|
||||||
Key: "type---",
|
Key: "type",
|
||||||
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
||||||
Type: "string",
|
Type: "string",
|
||||||
String_: "WebsiteRegistrationRecord",
|
String_: "WebsiteRegistrationRecord",
|
||||||
@ -88,11 +81,65 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
1,
|
1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Filter with attributes ServiceProviderRecord",
|
"Filter with tag (extant) (https://git.vdb.to/cerc-io/laconicd/issues/129)",
|
||||||
®istrytypes.QueryListRecordsRequest{
|
®istrytypes.QueryListRecordsRequest{
|
||||||
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
||||||
{
|
{
|
||||||
Key: "x500---state_name---",
|
Key: "tags",
|
||||||
|
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
||||||
|
Type: "string",
|
||||||
|
String_: "tagA",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
All: true,
|
||||||
|
},
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Filter with tag (non-existent) (https://git.vdb.to/cerc-io/laconicd/issues/129)",
|
||||||
|
®istrytypes.QueryListRecordsRequest{
|
||||||
|
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
||||||
|
{
|
||||||
|
Key: "tags",
|
||||||
|
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
||||||
|
Type: "string",
|
||||||
|
String_: "NOEXIST",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
All: true,
|
||||||
|
},
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Filter test for key collision (https://git.vdb.to/cerc-io/laconicd/issues/122)",
|
||||||
|
®istrytypes.QueryListRecordsRequest{
|
||||||
|
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
||||||
|
{
|
||||||
|
Key: "typ",
|
||||||
|
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
||||||
|
Type: "string",
|
||||||
|
String_: "eWebsiteRegistrationRecord",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
All: true,
|
||||||
|
},
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Filter with attributes ServiceProviderRegistration",
|
||||||
|
®istrytypes.QueryListRecordsRequest{
|
||||||
|
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
||||||
|
{
|
||||||
|
Key: "x500state_name",
|
||||||
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
||||||
Type: "string",
|
Type: "string",
|
||||||
String_: "california",
|
String_: "california",
|
||||||
@ -105,42 +152,6 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
false,
|
false,
|
||||||
1,
|
1,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"Filter with attributes WatcherRegistrationRecord",
|
|
||||||
®istrytypes.QueryListRecordsRequest{
|
|
||||||
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
|
||||||
{
|
|
||||||
Key: "metadata---chain_reference---/---",
|
|
||||||
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
|
||||||
Type: "string",
|
|
||||||
String_: "QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
All: true,
|
|
||||||
},
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Filter with attributes version",
|
|
||||||
®istrytypes.QueryListRecordsRequest{
|
|
||||||
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
|
||||||
{
|
|
||||||
Key: "version---",
|
|
||||||
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
|
||||||
Type: "string",
|
|
||||||
String_: "1.0.0",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
All: true,
|
|
||||||
},
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
7,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
for _, test := range testCases {
|
for _, test := range testCases {
|
||||||
suite.Run(fmt.Sprintf("Case %s ", test.msg), func() {
|
suite.Run(fmt.Sprintf("Case %s ", test.msg), func() {
|
||||||
@ -167,7 +178,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
} else {
|
} else {
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.Equal(test.noOfRecords, len(resp.GetRecords()))
|
sr.Equal(test.noOfRecords, len(resp.GetRecords()))
|
||||||
if test.createRecords {
|
if test.createRecords && test.noOfRecords > 0 {
|
||||||
recordId = resp.GetRecords()[0].GetId()
|
recordId = resp.GetRecords()[0].GetId()
|
||||||
sr.NotZero(resp.GetRecords())
|
sr.NotZero(resp.GetRecords())
|
||||||
sr.Equal(resp.GetRecords()[0].GetBondId(), suite.bond.GetId())
|
sr.Equal(resp.GetRecords()[0].GetBondId(), suite.bond.GetId())
|
||||||
@ -177,7 +188,26 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
recAttr := helpers.UnMarshalMapFromJSONBytes(bz)
|
recAttr := helpers.UnMarshalMapFromJSONBytes(bz)
|
||||||
for _, attr := range test.req.GetAttributes() {
|
for _, attr := range test.req.GetAttributes() {
|
||||||
sr.Equal(keeper.GetAttributeValue(attr.Value), getAttributesFromRecord(recAttr, attr.Key))
|
av := keeper.GetAttributeValue(attr.Value)
|
||||||
|
if nil != av && nil != recAttr[attr.Key] &&
|
||||||
|
reflect.Slice == reflect.TypeOf(recAttr[attr.Key]).Kind() &&
|
||||||
|
reflect.Slice != reflect.TypeOf(av).Kind() {
|
||||||
|
found := false
|
||||||
|
allValues := recAttr[attr.Key].([]interface{})
|
||||||
|
for i := range allValues {
|
||||||
|
if av == allValues[i] {
|
||||||
|
fmt.Printf("Found %s in %s", allValues[i], recAttr[attr.Key])
|
||||||
|
found = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sr.Equal(true, found, fmt.Sprintf("Unable to find %s in %s", av, recAttr[attr.Key]))
|
||||||
|
} else {
|
||||||
|
if attr.Key[:4] == "x500" {
|
||||||
|
sr.Equal(av, recAttr["x500"].(map[string]interface{})[attr.Key[4:]])
|
||||||
|
} else {
|
||||||
|
sr.Equal(av, recAttr[attr.Key])
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -268,17 +298,6 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getAttributesFromRecord(recordAttr map[string]interface{}, key string) interface{} {
|
|
||||||
keys := strings.Split(key, "---")
|
|
||||||
for i, str := range keys {
|
|
||||||
if i == len(keys)-2 {
|
|
||||||
return recordAttr[str].(string)
|
|
||||||
}
|
|
||||||
recordAttr = recordAttr[str].(map[string]interface{})
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (suite *KeeperTestSuite) TestGrpcQueryRegistryModuleBalance() {
|
func (suite *KeeperTestSuite) TestGrpcQueryRegistryModuleBalance() {
|
||||||
grpcClient, ctx := suite.queryClient, suite.ctx
|
grpcClient, ctx := suite.queryClient, suite.ctx
|
||||||
sr := suite.Require()
|
sr := suite.Require()
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect" // #nosec G702 This is also used in eip712 antehandler code. No new risk introduced.
|
"reflect"
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -21,6 +21,7 @@ import (
|
|||||||
auth "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
auth "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||||
bank "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
bank "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||||
|
"github.com/tendermint/tendermint/libs/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -97,6 +98,11 @@ func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeep
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Logger returns a module-specific logger.
|
||||||
|
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
|
||||||
|
return ctx.Logger().With("module", types.ModuleName)
|
||||||
|
}
|
||||||
|
|
||||||
// GetRecordIndexKey Generates Bond ID -> Bond index key.
|
// GetRecordIndexKey Generates Bond ID -> Bond index key.
|
||||||
func GetRecordIndexKey(id string) []byte {
|
func GetRecordIndexKey(id string) []byte {
|
||||||
return append(PrefixCIDToRecordIndex, []byte(id)...)
|
return append(PrefixCIDToRecordIndex, []byte(id)...)
|
||||||
@ -318,44 +324,68 @@ func (k Keeper) PutRecord(ctx sdk.Context, record types.Record) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (k Keeper) ProcessAttributes(ctx sdk.Context, record types.RecordType) error {
|
func (k Keeper) ProcessAttributes(ctx sdk.Context, record types.RecordType) error {
|
||||||
if err := k.insertAttributes(ctx, record.ID, record.Attributes, ""); err != nil {
|
switch record.Attributes["type"] {
|
||||||
return err
|
case "ServiceProviderRegistration":
|
||||||
}
|
{
|
||||||
|
|
||||||
expiryTimeKey := GetAttributesIndexKey(ExpiryTimeAttributeName, record.ExpiryTime)
|
|
||||||
if err := k.setAttributeMapping(ctx, expiryTimeKey, record.ID); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (k Keeper) insertAttributes(ctx sdk.Context, recordID string, attr interface{}, keyPrefix string) error {
|
|
||||||
if reflect.TypeOf(attr).Kind() == reflect.Map {
|
|
||||||
val := attr.(map[string]interface{})
|
|
||||||
// #nosec G705
|
// #nosec G705
|
||||||
for key := range val {
|
for key := range record.Attributes {
|
||||||
newKeyPrefix := fmt.Sprint(keyPrefix + key + "---")
|
if key == "x500" {
|
||||||
if err := k.insertAttributes(ctx, recordID, val[key], newKeyPrefix); err != nil {
|
// #nosec G705
|
||||||
|
for x500Key, x500Val := range record.Attributes[key].(map[string]interface{}) {
|
||||||
|
indexKey := GetAttributesIndexKey(fmt.Sprintf("x500%s", x500Key), x500Val)
|
||||||
|
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
indexKey := GetAttributesIndexKey(keyPrefix, attr)
|
indexKey := GetAttributesIndexKey(key, record.Attributes[key])
|
||||||
if err := k.setAttributeMapping(ctx, indexKey, recordID); err != nil {
|
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "WebsiteRegistrationRecord", "ApplicationRecord", "ApplicationDeploymentRequest",
|
||||||
|
"ApplicationDeploymentRecord", "ApplicationArtifact", "ApplicationDeploymentRemovalRequest",
|
||||||
|
"ApplicationDeploymentRemovalRecord", "DnsRecord", "GeneralRecord":
|
||||||
|
{
|
||||||
|
// #nosec G705
|
||||||
|
for key := range record.Attributes {
|
||||||
|
attr := record.Attributes[key]
|
||||||
|
if reflect.Slice == reflect.TypeOf(attr).Kind() {
|
||||||
|
av := attr.([]interface{})
|
||||||
|
for i := range av {
|
||||||
|
indexKey := GetAttributesIndexKey(key, av[i])
|
||||||
|
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
indexKey := GetAttributesIndexKey(key, attr)
|
||||||
|
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("unsupported record type %s", record.Attributes["type"])
|
||||||
|
}
|
||||||
|
|
||||||
|
expiryTimeKey := GetAttributesIndexKey(ExpiryTimeAttributeName, record.ExpiryTime)
|
||||||
|
if err := k.SetAttributeMapping(ctx, expiryTimeKey, record.ID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetAttributesIndexKey(key string, value interface{}) []byte {
|
func GetAttributesIndexKey(key string, value interface{}) []byte {
|
||||||
keyString := fmt.Sprintf("%s%s", key, value)
|
keyString := fmt.Sprintf("%s=%s", key, value)
|
||||||
return append(PrefixAttributesIndex, []byte(keyString)...)
|
return append(PrefixAttributesIndex, []byte(keyString)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k Keeper) setAttributeMapping(ctx sdk.Context, key []byte, recordID string) error {
|
func (k Keeper) SetAttributeMapping(ctx sdk.Context, key []byte, recordID string) error {
|
||||||
store := ctx.KVStore(k.storeKey)
|
store := ctx.KVStore(k.storeKey)
|
||||||
var recordIds []string
|
var recordIds []string
|
||||||
if store.Has(key) {
|
if store.Has(key) {
|
||||||
@ -379,7 +409,8 @@ func (k Keeper) GetAttributeMapping(ctx sdk.Context, key []byte) ([]string, erro
|
|||||||
store := ctx.KVStore(k.storeKey)
|
store := ctx.KVStore(k.storeKey)
|
||||||
|
|
||||||
if !store.Has(key) {
|
if !store.Has(key) {
|
||||||
return nil, fmt.Errorf("store doesn't have key")
|
k.Logger(ctx).Debug(fmt.Sprintf("store doesn't have key: %q", key))
|
||||||
|
return []string{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var recordIds []string
|
var recordIds []string
|
||||||
|
7700
x/registry/types/attributes.pb.go
generated
7700
x/registry/types/attributes.pb.go
generated
File diff suppressed because it is too large
Load Diff
@ -40,9 +40,9 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
registry.RegisterInterface(
|
registry.RegisterInterface(
|
||||||
"vulcanize.registry.v1beta1.ServiceProviderRecord",
|
"vulcanize.registry.v1beta1.ServiceProvideRegistration",
|
||||||
(*Attributes)(nil),
|
(*Attributes)(nil),
|
||||||
&ServiceProviderRecord{},
|
&ServiceProviderRegistration{},
|
||||||
)
|
)
|
||||||
|
|
||||||
registry.RegisterInterface(
|
registry.RegisterInterface(
|
||||||
@ -52,45 +52,51 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
registry.RegisterInterface(
|
registry.RegisterInterface(
|
||||||
"vulcanize.registry.v1beta1.GitRepository",
|
"vulcanize.registry.v1beta1.ApplicationRecord",
|
||||||
(*Attributes)(nil),
|
(*Attributes)(nil),
|
||||||
&GitRepository{},
|
&ApplicationRecord{},
|
||||||
)
|
)
|
||||||
|
|
||||||
registry.RegisterInterface(
|
registry.RegisterInterface(
|
||||||
"vulcanize.registry.v1beta1.Binary",
|
"vulcanize.registry.v1beta1.ApplicationDeploymentRequest",
|
||||||
(*Attributes)(nil),
|
(*Attributes)(nil),
|
||||||
&Binary{},
|
&ApplicationDeploymentRequest{},
|
||||||
)
|
)
|
||||||
|
|
||||||
registry.RegisterInterface(
|
registry.RegisterInterface(
|
||||||
"vulcanize.registry.v1beta1.DockerImage",
|
"vulcanize.registry.v1beta1.ApplicationDeploymentRecord",
|
||||||
(*Attributes)(nil),
|
(*Attributes)(nil),
|
||||||
&DockerImage{},
|
&ApplicationDeploymentRecord{},
|
||||||
)
|
)
|
||||||
|
|
||||||
registry.RegisterInterface(
|
registry.RegisterInterface(
|
||||||
"vulcanize.registry.v1beta1.WatcherRegistrationRecord",
|
"vulcanize.registry.v1beta1.ApplicationArtifact",
|
||||||
(*Attributes)(nil),
|
(*Attributes)(nil),
|
||||||
&WatcherRegistrationRecord{},
|
&ApplicationArtifact{},
|
||||||
)
|
)
|
||||||
|
|
||||||
registry.RegisterInterface(
|
registry.RegisterInterface(
|
||||||
"vulcanize.registry.v1beta1.ResponderContract",
|
"vulcanize.registry.v1beta1.ApplicationDeploymentRemovalRequest",
|
||||||
(*Attributes)(nil),
|
(*Attributes)(nil),
|
||||||
&ResponderContract{},
|
&ApplicationDeploymentRemovalRequest{},
|
||||||
)
|
)
|
||||||
|
|
||||||
registry.RegisterInterface(
|
registry.RegisterInterface(
|
||||||
"vulcanize.registry.v1beta1.JSPackage",
|
"vulcanize.registry.v1beta1.ApplicationDeploymentRemovalRecord",
|
||||||
(*Attributes)(nil),
|
(*Attributes)(nil),
|
||||||
&JSPackage{},
|
&ApplicationDeploymentRemovalRecord{},
|
||||||
)
|
)
|
||||||
|
|
||||||
registry.RegisterInterface(
|
registry.RegisterInterface(
|
||||||
"vulcanize.registry.v1beta1.ChainRegistrationRecord",
|
"vulcanize.registry.v1beta1.DnsRecord",
|
||||||
(*Attributes)(nil),
|
(*Attributes)(nil),
|
||||||
&ChainRegistrationRecord{},
|
&DnsRecord{},
|
||||||
|
)
|
||||||
|
|
||||||
|
registry.RegisterInterface(
|
||||||
|
"vulcanize.registry.v1beta1.GeneralRecord",
|
||||||
|
(*Attributes)(nil),
|
||||||
|
&GeneralRecord{},
|
||||||
)
|
)
|
||||||
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
||||||
}
|
}
|
||||||
|
918
x/registry/types/tx.pb.gw.go
generated
Normal file
918
x/registry/types/tx.pb.gw.go
generated
Normal file
@ -0,0 +1,918 @@
|
|||||||
|
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||||
|
// source: vulcanize/registry/v1beta1/tx.proto
|
||||||
|
|
||||||
|
/*
|
||||||
|
Package types is a reverse proxy.
|
||||||
|
|
||||||
|
It translates gRPC into RESTful JSON APIs.
|
||||||
|
*/
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/descriptor"
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||||
|
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
"google.golang.org/grpc/codes"
|
||||||
|
"google.golang.org/grpc/grpclog"
|
||||||
|
"google.golang.org/grpc/metadata"
|
||||||
|
"google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Suppress "imported and not used" errors
|
||||||
|
var _ codes.Code
|
||||||
|
var _ io.Reader
|
||||||
|
var _ status.Status
|
||||||
|
var _ = runtime.String
|
||||||
|
var _ = utilities.NewDoubleArray
|
||||||
|
var _ = descriptor.ForMessage
|
||||||
|
var _ = metadata.Join
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_SetRecord_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_SetRecord_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgSetRecord
|
||||||
|
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_Msg_SetRecord_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.SetRecord(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_SetRecord_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgSetRecord
|
||||||
|
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_Msg_SetRecord_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.SetRecord(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_RenewRecord_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_RenewRecord_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgRenewRecord
|
||||||
|
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_Msg_RenewRecord_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.RenewRecord(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_RenewRecord_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgRenewRecord
|
||||||
|
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_Msg_RenewRecord_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.RenewRecord(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_AssociateBond_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_AssociateBond_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgAssociateBond
|
||||||
|
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_Msg_AssociateBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.AssociateBond(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_AssociateBond_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgAssociateBond
|
||||||
|
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_Msg_AssociateBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.AssociateBond(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_DissociateBond_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_DissociateBond_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgDissociateBond
|
||||||
|
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_Msg_DissociateBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.DissociateBond(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_DissociateBond_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgDissociateBond
|
||||||
|
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_Msg_DissociateBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.DissociateBond(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_DissociateRecords_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_DissociateRecords_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgDissociateRecords
|
||||||
|
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_Msg_DissociateRecords_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.DissociateRecords(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_DissociateRecords_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgDissociateRecords
|
||||||
|
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_Msg_DissociateRecords_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.DissociateRecords(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_ReAssociateRecords_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_ReAssociateRecords_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgReAssociateRecords
|
||||||
|
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_Msg_ReAssociateRecords_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.ReAssociateRecords(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_ReAssociateRecords_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgReAssociateRecords
|
||||||
|
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_Msg_ReAssociateRecords_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.ReAssociateRecords(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_SetName_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_SetName_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgSetName
|
||||||
|
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_Msg_SetName_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.SetName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_SetName_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgSetName
|
||||||
|
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_Msg_SetName_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.SetName(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_ReserveName_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_ReserveName_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgReserveAuthority
|
||||||
|
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_Msg_ReserveName_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.ReserveName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_ReserveName_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgReserveAuthority
|
||||||
|
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_Msg_ReserveName_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.ReserveName(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_DeleteName_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_DeleteName_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgDeleteNameAuthority
|
||||||
|
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_Msg_DeleteName_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.DeleteName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_DeleteName_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgDeleteNameAuthority
|
||||||
|
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_Msg_DeleteName_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.DeleteName(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_SetAuthorityBond_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_SetAuthorityBond_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgSetAuthorityBond
|
||||||
|
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_Msg_SetAuthorityBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.SetAuthorityBond(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_SetAuthorityBond_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgSetAuthorityBond
|
||||||
|
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_Msg_SetAuthorityBond_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.SetAuthorityBond(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux".
|
||||||
|
// UnaryRPC :call MsgServer directly.
|
||||||
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead.
|
||||||
|
func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error {
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_SetRecord_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_SetRecord_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_SetRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_RenewRecord_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_RenewRecord_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_RenewRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_AssociateBond_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_AssociateBond_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_AssociateBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_DissociateBond_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_DissociateBond_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_DissociateBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_DissociateRecords_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_DissociateRecords_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_DissociateRecords_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_ReAssociateRecords_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_ReAssociateRecords_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_ReAssociateRecords_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_SetName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_SetName_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_SetName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_ReserveName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_ReserveName_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_ReserveName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_DeleteName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_DeleteName_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_DeleteName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_SetAuthorityBond_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Msg_SetAuthorityBond_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_SetAuthorityBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but
|
||||||
|
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||||
|
func RegisterMsgHandlerFromEndpoint(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 RegisterMsgHandler(ctx, mux, conn)
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMsgHandler registers the http handlers for service Msg to "mux".
|
||||||
|
// The handlers forward requests to the grpc endpoint over "conn".
|
||||||
|
func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||||
|
return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn))
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMsgHandlerClient registers the http handlers for service Msg
|
||||||
|
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient".
|
||||||
|
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient"
|
||||||
|
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||||
|
// "MsgClient" to call the correct interceptors.
|
||||||
|
func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error {
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_SetRecord_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_Msg_SetRecord_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_SetRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_RenewRecord_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_Msg_RenewRecord_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_RenewRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_AssociateBond_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_Msg_AssociateBond_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_AssociateBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_DissociateBond_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_Msg_DissociateBond_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_DissociateBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_DissociateRecords_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_Msg_DissociateRecords_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_DissociateRecords_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_ReAssociateRecords_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_Msg_ReAssociateRecords_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_ReAssociateRecords_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_SetName_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_Msg_SetName_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_SetName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_ReserveName_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_Msg_ReserveName_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_ReserveName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_DeleteName_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_Msg_DeleteName_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_DeleteName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_SetAuthorityBond_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_Msg_SetAuthorityBond_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_SetAuthorityBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
pattern_Msg_SetRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "registry", "v1beta1", "set_record"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_RenewRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "registry", "v1beta1", "renew_record"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_AssociateBond_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "registry", "v1beta1", "associate_bond"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_DissociateBond_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "registry", "v1beta1", "dissociate_bond"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_DissociateRecords_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "registry", "v1beta1", "dissociate_records"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_ReAssociateRecords_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "registry", "v1beta1", "reassociate_records"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_SetName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "registry", "v1beta1", "set_name"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_ReserveName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "registry", "v1beta1", "reserve_name"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_DeleteName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "registry", "v1beta1", "delete_name"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_SetAuthorityBond_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "registry", "v1beta1", "set_authority_bond"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
forward_Msg_SetRecord_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_RenewRecord_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_AssociateBond_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_DissociateBond_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_DissociateRecords_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_ReAssociateRecords_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_SetName_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_ReserveName_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_DeleteName_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_SetAuthorityBond_0 = runtime.ForwardResponseMessage
|
||||||
|
)
|
@ -50,9 +50,9 @@ func payLoadAttributes(recordPayLoad map[string]interface{}) (*codectypes.Any, e
|
|||||||
bz := helpers.MarshalMapToJSONBytes(recordPayLoad)
|
bz := helpers.MarshalMapToJSONBytes(recordPayLoad)
|
||||||
|
|
||||||
switch recordType.(string) {
|
switch recordType.(string) {
|
||||||
case "ServiceProviderRecord":
|
case "ServiceProviderRegistration":
|
||||||
{
|
{
|
||||||
var attributes ServiceProviderRecord
|
var attributes ServiceProviderRegistration
|
||||||
err := json.Unmarshal(bz, &attributes)
|
err := json.Unmarshal(bz, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &codectypes.Any{}, err
|
return &codectypes.Any{}, err
|
||||||
@ -68,63 +68,72 @@ func payLoadAttributes(recordPayLoad map[string]interface{}) (*codectypes.Any, e
|
|||||||
}
|
}
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
}
|
}
|
||||||
case "GitRepository":
|
case "ApplicationRecord":
|
||||||
{
|
{
|
||||||
var attributes GitRepository
|
var attributes ApplicationRecord
|
||||||
err := json.Unmarshal(bz, &attributes)
|
err := json.Unmarshal(bz, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &codectypes.Any{}, err
|
return &codectypes.Any{}, err
|
||||||
}
|
}
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
}
|
}
|
||||||
case "Binary":
|
case "ApplicationDeploymentRequest":
|
||||||
{
|
{
|
||||||
var attributes Binary
|
var attributes ApplicationDeploymentRequest
|
||||||
err := json.Unmarshal(bz, &attributes)
|
err := json.Unmarshal(bz, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &codectypes.Any{}, err
|
return &codectypes.Any{}, err
|
||||||
}
|
}
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
}
|
}
|
||||||
case "DockerImage":
|
case "ApplicationDeploymentRecord":
|
||||||
{
|
{
|
||||||
var attributes DockerImage
|
var attributes ApplicationDeploymentRecord
|
||||||
err := json.Unmarshal(bz, &attributes)
|
err := json.Unmarshal(bz, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &codectypes.Any{}, err
|
return &codectypes.Any{}, err
|
||||||
}
|
}
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
}
|
}
|
||||||
case "WatcherRegistrationRecord":
|
case "ApplicationDeploymentRemovalRequest":
|
||||||
{
|
{
|
||||||
var attributes WatcherRegistrationRecord
|
var attributes ApplicationDeploymentRemovalRequest
|
||||||
err := json.Unmarshal(bz, &attributes)
|
err := json.Unmarshal(bz, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &codectypes.Any{}, err
|
return &codectypes.Any{}, err
|
||||||
}
|
}
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
}
|
}
|
||||||
case "ResponderContract":
|
case "ApplicationDeploymentRemovalRecord":
|
||||||
{
|
{
|
||||||
var attributes ResponderContract
|
var attributes ApplicationDeploymentRemovalRecord
|
||||||
err := json.Unmarshal(bz, &attributes)
|
err := json.Unmarshal(bz, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &codectypes.Any{}, err
|
return &codectypes.Any{}, err
|
||||||
}
|
}
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
}
|
}
|
||||||
case "JSPackage":
|
case "ApplicationArtifact":
|
||||||
{
|
{
|
||||||
var attributes JSPackage
|
var attributes ApplicationArtifact
|
||||||
err := json.Unmarshal(bz, &attributes)
|
err := json.Unmarshal(bz, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &codectypes.Any{}, err
|
return &codectypes.Any{}, err
|
||||||
}
|
}
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
}
|
}
|
||||||
case "ChainRegistrationRecord":
|
case "DnsRecord":
|
||||||
{
|
{
|
||||||
var attributes ChainRegistrationRecord
|
var attributes DnsRecord
|
||||||
|
err := json.Unmarshal(bz, &attributes)
|
||||||
|
if err != nil {
|
||||||
|
return &codectypes.Any{}, err
|
||||||
|
}
|
||||||
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
|
}
|
||||||
|
case "GeneralRecord":
|
||||||
|
{
|
||||||
|
var attributes GeneralRecord
|
||||||
err := json.Unmarshal(bz, &attributes)
|
err := json.Unmarshal(bz, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &codectypes.Any{}, err
|
return &codectypes.Any{}, err
|
||||||
@ -177,9 +186,9 @@ func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) {
|
|||||||
var bz []byte
|
var bz []byte
|
||||||
s := strings.Split(any.TypeUrl, ".")
|
s := strings.Split(any.TypeUrl, ".")
|
||||||
switch s[len(s)-1] {
|
switch s[len(s)-1] {
|
||||||
case "ServiceProviderRecord":
|
case "ServiceProviderRegistration":
|
||||||
{
|
{
|
||||||
var attributes ServiceProviderRecord
|
var attributes ServiceProviderRegistration
|
||||||
err := proto.Unmarshal(any.Value, &attributes)
|
err := proto.Unmarshal(any.Value, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("Proto unmarshal error")
|
panic("Proto unmarshal error")
|
||||||
@ -203,9 +212,9 @@ func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) {
|
|||||||
panic("JSON marshal error")
|
panic("JSON marshal error")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "GitRepository":
|
case "ApplicationRecord":
|
||||||
{
|
{
|
||||||
var attributes GitRepository
|
var attributes ApplicationRecord
|
||||||
err := proto.Unmarshal(any.Value, &attributes)
|
err := proto.Unmarshal(any.Value, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("Proto unmarshal error")
|
panic("Proto unmarshal error")
|
||||||
@ -216,9 +225,9 @@ func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) {
|
|||||||
panic("JSON marshal error")
|
panic("JSON marshal error")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "Binary":
|
case "ApplicationDeploymentRequest":
|
||||||
{
|
{
|
||||||
var attributes Binary
|
var attributes ApplicationDeploymentRequest
|
||||||
err := proto.Unmarshal(any.Value, &attributes)
|
err := proto.Unmarshal(any.Value, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("Proto unmarshal error")
|
panic("Proto unmarshal error")
|
||||||
@ -229,9 +238,9 @@ func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) {
|
|||||||
panic("JSON marshal error")
|
panic("JSON marshal error")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "DockerImage":
|
case "ApplicationDeploymentRecord":
|
||||||
{
|
{
|
||||||
var attributes DockerImage
|
var attributes ApplicationDeploymentRecord
|
||||||
err := proto.Unmarshal(any.Value, &attributes)
|
err := proto.Unmarshal(any.Value, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("Proto unmarshal error")
|
panic("Proto unmarshal error")
|
||||||
@ -242,9 +251,9 @@ func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) {
|
|||||||
panic("JSON marshal error")
|
panic("JSON marshal error")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "WatcherRegistrationRecord":
|
case "ApplicationDeploymentRemovalRequest":
|
||||||
{
|
{
|
||||||
var attributes WatcherRegistrationRecord
|
var attributes ApplicationDeploymentRemovalRequest
|
||||||
err := proto.Unmarshal(any.Value, &attributes)
|
err := proto.Unmarshal(any.Value, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("Proto unmarshal error")
|
panic("Proto unmarshal error")
|
||||||
@ -255,9 +264,9 @@ func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) {
|
|||||||
panic("JSON marshal error")
|
panic("JSON marshal error")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "ResponderContract":
|
case "ApplicationDeploymentRemovalRecord":
|
||||||
{
|
{
|
||||||
var attributes ResponderContract
|
var attributes ApplicationDeploymentRemovalRecord
|
||||||
err := proto.Unmarshal(any.Value, &attributes)
|
err := proto.Unmarshal(any.Value, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("Proto unmarshal error")
|
panic("Proto unmarshal error")
|
||||||
@ -268,9 +277,9 @@ func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) {
|
|||||||
panic("JSON marshal error")
|
panic("JSON marshal error")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "JSPackage":
|
case "ApplicationArtifact":
|
||||||
{
|
{
|
||||||
var attributes JSPackage
|
var attributes ApplicationArtifact
|
||||||
err := proto.Unmarshal(any.Value, &attributes)
|
err := proto.Unmarshal(any.Value, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("Proto unmarshal error")
|
panic("Proto unmarshal error")
|
||||||
@ -281,9 +290,22 @@ func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) {
|
|||||||
panic("JSON marshal error")
|
panic("JSON marshal error")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "ChainRegistrationRecord":
|
case "DnsRecord":
|
||||||
{
|
{
|
||||||
var attributes ChainRegistrationRecord
|
var attributes DnsRecord
|
||||||
|
err := proto.Unmarshal(any.Value, &attributes)
|
||||||
|
if err != nil {
|
||||||
|
panic("Proto unmarshal error")
|
||||||
|
}
|
||||||
|
|
||||||
|
bz, err = json.Marshal(attributes)
|
||||||
|
if err != nil {
|
||||||
|
panic("JSON marshal error")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "GeneralRecord":
|
||||||
|
{
|
||||||
|
var attributes GeneralRecord
|
||||||
err := proto.Unmarshal(any.Value, &attributes)
|
err := proto.Unmarshal(any.Value, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("Proto unmarshal error")
|
panic("Proto unmarshal error")
|
||||||
|
Loading…
Reference in New Issue
Block a user