forked from cerc-io/laconicd-deprecated
Compare commits
7 Commits
main
...
roy/qol-im
Author | SHA1 | Date | |
---|---|---|---|
1646dd6d05 | |||
981bd6a5b2 | |||
5fe9add0af | |||
006655f0f8 | |||
d82c676777 | |||
61fe74ca3b | |||
afc40702e2 |
@ -1,5 +1,7 @@
|
|||||||
# localnet-setup
|
Dockerfile
|
||||||
localnet-setup
|
|
||||||
|
|
||||||
# build
|
**/node_modules
|
||||||
build
|
init.sh
|
||||||
|
|
||||||
|
build
|
||||||
|
localnet-setup
|
5
.github/CODEOWNERS
vendored
5
.github/CODEOWNERS
vendored
@ -1,5 +0,0 @@
|
|||||||
# CODEOWNERS: https://help.github.com/articles/about-codeowners/
|
|
||||||
|
|
||||||
# Primary (global) repo maintainers
|
|
||||||
|
|
||||||
* @evmos/core-engineering
|
|
7
.github/workflows/dependencies.yml
vendored
7
.github/workflows/dependencies.yml
vendored
@ -23,7 +23,6 @@ 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
|
||||||
# TODO: https://git.vdb.to/cerc-io/laconicd/issues/115
|
- name: "Go vulnerability check"
|
||||||
# - name: "Go vulnerability check"
|
run: make vulncheck
|
||||||
# run: make vulncheck
|
if: env.GIT_DIFF
|
||||||
# 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@v20
|
- uses: cachix/install-nix-action@v18
|
||||||
- uses: cachix/cachix-action@v12
|
- uses: cachix/cachix-action@v12
|
||||||
with:
|
with:
|
||||||
name: ethermint
|
name: ethermint
|
||||||
|
21
.github/workflows/stale.yml
vendored
Normal file
21
.github/workflows/stale.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
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"
|
41
.github/workflows/test.yml
vendored
41
.github/workflows/test.yml
vendored
@ -94,39 +94,34 @@ jobs:
|
|||||||
ref: jest_timeout
|
ref: jest_timeout
|
||||||
- name: Environment
|
- name: Environment
|
||||||
run: ls -tlh && env
|
run: ls -tlh && env
|
||||||
- name: build containers scripts
|
- name: Build containers scripts
|
||||||
working-directory: tests/sdk_tests
|
working-directory: tests/sdk_tests
|
||||||
run: ./build-laconicd-container.sh && ./build-sdk-test-container.sh
|
run: ./build-laconicd-container.sh && ./build-sdk-test-container.sh
|
||||||
- name: start containers
|
|
||||||
|
- name: Start containers
|
||||||
working-directory: tests/sdk_tests
|
working-directory: tests/sdk_tests
|
||||||
run: docker compose up -d
|
run: docker compose up -d
|
||||||
- name: run-tests.sh
|
- name: Run tests
|
||||||
working-directory: tests/sdk_tests
|
working-directory: tests/sdk_tests
|
||||||
run: ./run-tests.sh
|
run: ./run-tests.sh
|
||||||
- name: reset containers for auction tests
|
|
||||||
|
- name: Start auction containers
|
||||||
working-directory: tests/sdk_tests
|
working-directory: tests/sdk_tests
|
||||||
if: always()
|
env:
|
||||||
run: docker compose down
|
TEST_AUCTION_ENABLED: true
|
||||||
- name: start auction containers
|
run: docker compose up -d
|
||||||
|
- name: Run auction tests
|
||||||
working-directory: tests/sdk_tests
|
working-directory: tests/sdk_tests
|
||||||
run: docker compose -f docker-compose-auctions.yml up -d
|
run: ./run-tests.sh test:auctions
|
||||||
- name: run-acution-tests.sh
|
|
||||||
|
- name: Start auction containers
|
||||||
working-directory: tests/sdk_tests
|
working-directory: tests/sdk_tests
|
||||||
run: ./run-auction-tests.sh
|
env:
|
||||||
- name: reset containers for nameservice tests
|
TEST_REGISTRY_EXPIRY: true
|
||||||
|
run: docker compose up -d
|
||||||
|
- name: Run nameservice expiry tests
|
||||||
working-directory: tests/sdk_tests
|
working-directory: tests/sdk_tests
|
||||||
if: always()
|
run: ./run-tests.sh test:nameservice-expiry
|
||||||
run: docker compose -f docker-compose-auctions.yml down
|
|
||||||
- name: start auction containers
|
|
||||||
working-directory: tests/sdk_tests
|
|
||||||
run: docker compose -f docker-compose-nameservice.yml up -d
|
|
||||||
- name: run-nameservice-expiry-tests.sh
|
|
||||||
working-directory: tests/sdk_tests
|
|
||||||
run: ./run-nameservice-expiry-tests.sh
|
|
||||||
- name: reset containers for nameservice tests
|
|
||||||
working-directory: tests/sdk_tests
|
|
||||||
if: always()
|
|
||||||
run: docker compose -f docker-compose-nameservice.yml down
|
|
||||||
|
|
||||||
# integration_tests:
|
# integration_tests:
|
||||||
# runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
|
@ -6,14 +6,14 @@ run:
|
|||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
- bodyclose
|
- bodyclose
|
||||||
# - depguard # 20231120 disable until https://github.com/golangci/golangci-lint/issues/3906 is released
|
- depguard
|
||||||
- dogsled
|
- dogsled
|
||||||
- dupl
|
- dupl
|
||||||
- errcheck
|
- errcheck
|
||||||
- goconst
|
- goconst
|
||||||
- gocritic
|
- gocritic
|
||||||
- gofumpt
|
- gofumpt
|
||||||
# - revive # 20231120 overly sensitive unused detection
|
- revive
|
||||||
- gosec
|
- gosec
|
||||||
- gosimple
|
- gosimple
|
||||||
- govet
|
- govet
|
||||||
|
14
Dockerfile
14
Dockerfile
@ -1,14 +1,14 @@
|
|||||||
FROM golang:alpine AS build-env
|
FROM golang:alpine AS build-env
|
||||||
|
|
||||||
# Set up dependencies
|
# Install dependencies
|
||||||
ENV PACKAGES git build-base
|
RUN apk add --update git build-base linux-headers
|
||||||
|
|
||||||
# Set working directory for the build
|
# Set working directory for the build
|
||||||
WORKDIR /go/src/github.com/cerc-io/laconicd
|
WORKDIR /go/src/github.com/cerc-io/laconicd
|
||||||
|
|
||||||
# Install dependencies
|
# Cache Go modules
|
||||||
RUN apk add --update $PACKAGES
|
COPY go.mod go.sum ./
|
||||||
RUN apk add linux-headers
|
RUN go mod download
|
||||||
|
|
||||||
# Add source files
|
# Add source files
|
||||||
COPY . .
|
COPY . .
|
||||||
@ -21,10 +21,10 @@ FROM alpine:3.17.0
|
|||||||
|
|
||||||
# Install ca-certificates
|
# Install ca-certificates
|
||||||
RUN apk add --update ca-certificates jq curl
|
RUN apk add --update ca-certificates jq curl
|
||||||
WORKDIR /
|
|
||||||
|
|
||||||
# Copy over binaries from the build-env
|
# Copy over binaries from the build-env
|
||||||
COPY --from=build-env /go/src/github.com/cerc-io/laconicd/build/laconicd /usr/bin/laconicd
|
COPY --from=build-env /go/src/github.com/cerc-io/laconicd/build/laconicd /usr/bin/laconicd
|
||||||
|
|
||||||
|
WORKDIR /
|
||||||
# Run laconicd by default
|
# Run laconicd by default
|
||||||
CMD ["laconicd"]
|
ENTRYPOINT ["laconicd"]
|
||||||
|
8
Makefile
8
Makefile
@ -72,7 +72,7 @@ ifeq ($(ENABLE_ROCKSDB),true)
|
|||||||
BUILD_TAGS += rocksdb_build
|
BUILD_TAGS += rocksdb_build
|
||||||
test_tags += rocksdb_build
|
test_tags += rocksdb_build
|
||||||
else
|
else
|
||||||
$(warning RocksDB support is disabled; to build and test with RocksDB support, set ENABLE_ROCKSDB=true)
|
$(info RocksDB support is disabled; to build and test with RocksDB support, set ENABLE_ROCKSDB=true)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# DB backend selection
|
# DB backend selection
|
||||||
@ -145,7 +145,7 @@ docker-build:
|
|||||||
# update old container
|
# update old container
|
||||||
docker rm laconicd || true
|
docker rm laconicd || true
|
||||||
# create a new container from the latest image
|
# create a new container from the latest image
|
||||||
docker create --name laconic -t -i cerc-io/laconicd:latest laconicd
|
docker create --name laconic -t -i ${DOCKER_IMAGE}:${DOCKER_TAG} laconicd
|
||||||
# move the binaries to the ./build directory
|
# move the binaries to the ./build directory
|
||||||
mkdir -p ./build/
|
mkdir -p ./build/
|
||||||
docker cp laconic:/usr/bin/laconicd ./build/
|
docker cp laconic:/usr/bin/laconicd ./build/
|
||||||
@ -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@v3
|
@go get github.com/kevinburke/go-bindata/go-bindata
|
||||||
else
|
else
|
||||||
@echo "go-bindata already installed; skipping..."
|
@echo "go-bindata already installed; skipping..."
|
||||||
endif
|
endif
|
||||||
@ -316,7 +316,7 @@ TEST_TARGETS := test-unit test-unit-cover test-race
|
|||||||
# Test runs-specific rules. To add a new test target, just add
|
# Test runs-specific rules. To add a new test target, just add
|
||||||
# a new rule, customise ARGS or TEST_PACKAGES ad libitum, and
|
# a new rule, customise ARGS or TEST_PACKAGES ad libitum, and
|
||||||
# append the new rule to the TEST_TARGETS list.
|
# append the new rule to the TEST_TARGETS list.
|
||||||
test-unit: ARGS=-timeout=10m -race
|
test-unit: ARGS=-timeout=10m -race -test.v
|
||||||
test-unit: TEST_PACKAGES=$(PACKAGES_UNIT)
|
test-unit: TEST_PACKAGES=$(PACKAGES_UNIT)
|
||||||
|
|
||||||
test-race: ARGS=-race
|
test-race: ARGS=-race
|
||||||
|
1
go.mod
1
go.mod
@ -134,7 +134,6 @@ 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
|
||||||
|
6
go.sum
6
go.sum
@ -836,12 +836,6 @@ 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=
|
||||||
|
186
init.sh
186
init.sh
@ -5,117 +5,117 @@ CHAINID="laconic_9000-1"
|
|||||||
MONIKER="localtestnet"
|
MONIKER="localtestnet"
|
||||||
KEYRING="test"
|
KEYRING="test"
|
||||||
KEYALGO="eth_secp256k1"
|
KEYALGO="eth_secp256k1"
|
||||||
LOGLEVEL="info"
|
LOGLEVEL="${LOGLEVEL:-info}"
|
||||||
# trace evm
|
# trace evm
|
||||||
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 || {
|
||||||
command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 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 $HOME/.laconicd/*
|
rm -rf ~/.laconic*
|
||||||
rm -rf $HOME/.laconic/*
|
|
||||||
|
|
||||||
if [ -n "`which make`" ]; then
|
laconicd config keyring-backend $KEYRING
|
||||||
make install
|
laconicd config chain-id $CHAINID
|
||||||
fi
|
|
||||||
|
|
||||||
laconicd config keyring-backend $KEYRING
|
# if $KEY exists it should be deleted
|
||||||
laconicd config chain-id $CHAINID
|
laconicd keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO
|
||||||
|
|
||||||
# if $KEY exists it should be deleted
|
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
|
||||||
laconicd keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO
|
laconicd init $MONIKER --chain-id $CHAINID
|
||||||
|
|
||||||
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
|
update_genesis() {
|
||||||
laconicd init $MONIKER --chain-id $CHAINID
|
jq "$1" $HOME/.laconicd/config/genesis.json > $HOME/.laconicd/config/tmp_genesis.json &&
|
||||||
|
mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
}
|
||||||
|
|
||||||
# Change parameter token denominations to aphoton
|
# Change parameter token denominations to aphoton
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["staking"]["params"]["bond_denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["staking"]["params"]["bond_denom"]="aphoton"'
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["crisis"]["constant_fee"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["crisis"]["constant_fee"]["denom"]="aphoton"'
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="aphoton"'
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["mint"]["params"]["mint_denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["mint"]["params"]["mint_denom"]="aphoton"'
|
||||||
# Custom modules
|
# Custom modules
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["record_rent"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["registry"]["params"]["record_rent"]["denom"]="aphoton"'
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_rent"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["registry"]["params"]["authority_rent"]["denom"]="aphoton"'
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_commit_fee"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["registry"]["params"]["authority_auction_commit_fee"]["denom"]="aphoton"'
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_reveal_fee"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["registry"]["params"]["authority_auction_reveal_fee"]["denom"]="aphoton"'
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_minimum_bid"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["registry"]["params"]["authority_auction_minimum_bid"]["denom"]="aphoton"'
|
||||||
|
|
||||||
if [[ "$TEST_REGISTRY_EXPIRY" == "true" ]]; then
|
if [[ "$TEST_REGISTRY_EXPIRY" == "true" ]]; then
|
||||||
echo "Setting timers for expiry tests."
|
echo "Setting timers for expiry tests."
|
||||||
|
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["record_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["registry"]["params"]["record_rent_duration"]="60s"'
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_grace_period"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["registry"]["params"]["authority_grace_period"]="60s"'
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["registry"]["params"]["authority_rent_duration"]="60s"'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TEST_AUCTION_ENABLED" == "true" ]]; then
|
if [[ "$TEST_AUCTION_ENABLED" == "true" ]]; then
|
||||||
echo "Enabling auction and setting timers."
|
echo "Enabling auction and setting timers."
|
||||||
|
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_enabled"]=true' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["registry"]["params"]["authority_auction_enabled"]=true'
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["registry"]["params"]["authority_rent_duration"]="60s"'
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_grace_period"]="300s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["registry"]["params"]["authority_grace_period"]="300s"'
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_commits_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["registry"]["params"]["authority_auction_commits_duration"]="60s"'
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_reveals_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.app_state["registry"]["params"]["authority_auction_reveals_duration"]="60s"'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# increase block time (?)
|
# increase block time (?)
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.consensus_params["block"]["time_iota_ms"]="1000"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.consensus_params["block"]["time_iota_ms"]="1000"'
|
||||||
|
|
||||||
# Set gas limit in genesis
|
# Set gas limit in genesis
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.consensus_params["block"]["max_gas"]="10000000"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
update_genesis '.consensus_params["block"]["max_gas"]="10000000"'
|
||||||
|
|
||||||
# disable produce empty block
|
# disable produce empty block
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
sed -i '' 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
|
sed -i '' 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
|
||||||
else
|
|
||||||
sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $1 == "pending" ]]; then
|
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
||||||
sed -i '' 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i '' 's/timeout_propose = "3s"/timeout_propose = "30s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i '' 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i '' 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i '' 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i '' 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i '' 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i '' 's/timeout_commit = "5s"/timeout_commit = "150s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i '' 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
else
|
|
||||||
sed -i 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i 's/timeout_propose = "3s"/timeout_propose = "30s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i 's/timeout_commit = "5s"/timeout_commit = "150s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
sed -i 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' $HOME/.laconicd/config/config.toml
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Allocate genesis accounts (cosmos formatted addresses)
|
|
||||||
laconicd add-genesis-account $KEY 100000000000000000000000000aphoton --keyring-backend $KEYRING
|
|
||||||
|
|
||||||
# Sign genesis transaction
|
|
||||||
laconicd gentx $KEY 1000000000000000000000aphoton --keyring-backend $KEYRING --chain-id $CHAINID
|
|
||||||
|
|
||||||
# Collect genesis tx
|
|
||||||
laconicd collect-gentxs
|
|
||||||
|
|
||||||
# Run this to ensure everything worked and that the genesis file is setup correctly
|
|
||||||
laconicd validate-genesis
|
|
||||||
|
|
||||||
if [[ $1 == "pending" ]]; then
|
|
||||||
echo "pending mode is on, please wait for the first block committed."
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "Using existing database at $HOME/.laconicd. To replace, run '`basename $0` clean'"
|
sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$1" == "pending" ]]; then
|
||||||
|
alias sed-i="sed -i"
|
||||||
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
alias sed-i="sed -i ''"
|
||||||
|
fi
|
||||||
|
sed-i \
|
||||||
|
-e 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' \
|
||||||
|
-e 's/timeout_propose = "3s"/timeout_propose = "30s"/g' \
|
||||||
|
-e 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' \
|
||||||
|
-e 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' \
|
||||||
|
-e 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' \
|
||||||
|
-e 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' \
|
||||||
|
-e 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' \
|
||||||
|
-e 's/timeout_commit = "5s"/timeout_commit = "150s"/g' \
|
||||||
|
-e 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' \
|
||||||
|
$HOME/.laconicd/config/config.toml
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Allocate genesis accounts (cosmos formatted addresses)
|
||||||
|
laconicd add-genesis-account $KEY 100000000000000000000000000aphoton --keyring-backend $KEYRING
|
||||||
|
|
||||||
|
# Sign genesis transaction
|
||||||
|
laconicd gentx $KEY 1000000000000000000000aphoton --keyring-backend $KEYRING --chain-id $CHAINID
|
||||||
|
|
||||||
|
# Collect genesis tx
|
||||||
|
laconicd collect-gentxs
|
||||||
|
|
||||||
|
# Run this to ensure everything worked and that the genesis file is setup correctly
|
||||||
|
laconicd validate-genesis
|
||||||
|
|
||||||
|
if [[ "$1" == "pending" ]]; then
|
||||||
|
echo "pending mode is on, please wait for the first block committed."
|
||||||
fi
|
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
|
||||||
|
@ -30,102 +30,4 @@ message WebsiteRegistrationRecord {
|
|||||||
string tls_cert_cid = 4 [(gogoproto.moretags) = "json:\"TLSCertCID\" yaml:\"TLSCertCID\""];
|
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 ApplicationRecord {
|
|
||||||
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
|
||||||
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 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 ApplicationArtifact {
|
|
||||||
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
|
||||||
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
|
||||||
string description = 4 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
|
|
||||||
string version = 5 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
|
||||||
string application = 6 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
|
|
||||||
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 DnsRecord {
|
|
||||||
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
|
||||||
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
|
||||||
string version = 3 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
|
||||||
string resource_type = 4 [(gogoproto.moretags) = "json:\"resourceType\" yaml:\"resourceType\""];
|
|
||||||
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 ApplicationDeploymentRequest {
|
|
||||||
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
|
||||||
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
|
||||||
string version = 3 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
|
||||||
string application = 4 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
|
|
||||||
string dns = 5 [(gogoproto.moretags) = "json:\"dns\" yaml:\"dns\""];
|
|
||||||
string config = 6 [(gogoproto.moretags) = "json:\"config\" yaml:\"config\""];
|
|
||||||
string deployment = 7 [(gogoproto.moretags) = "json:\"deployment\" yaml:\"deployment\""];
|
|
||||||
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
|
||||||
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
|
||||||
}
|
|
||||||
|
|
||||||
message ApplicationDeploymentRecord {
|
|
||||||
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
|
||||||
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 ApplicationDeploymentRemovalRequest {
|
|
||||||
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
|
||||||
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 ApplicationDeploymentRemovalRecord {
|
|
||||||
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
|
||||||
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 GeneralRecord {
|
|
||||||
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
|
||||||
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 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\""];
|
|
||||||
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
|
||||||
}
|
|
@ -56,7 +56,7 @@ message Params {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Params defines the registry module records
|
// Record defines a registry record
|
||||||
message Record {
|
message Record {
|
||||||
string id = 1 [(gogoproto.moretags) = "json:\"id\" yaml:\"id\""];
|
string id = 1 [(gogoproto.moretags) = "json:\"id\" yaml:\"id\""];
|
||||||
string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
|
string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
|
||||||
@ -69,7 +69,7 @@ message Record {
|
|||||||
string type = 9 [(gogoproto.moretags) = "json:\"types\" yaml:\"types\""];
|
string type = 9 [(gogoproto.moretags) = "json:\"types\" yaml:\"types\""];
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuthorityEntry defines the registry module AuthorityEntries
|
// AuthorityEntry defines a registry authority
|
||||||
message AuthorityEntry {
|
message AuthorityEntry {
|
||||||
string name = 1;
|
string name = 1;
|
||||||
NameAuthority entry = 2;
|
NameAuthority entry = 2;
|
||||||
@ -99,7 +99,7 @@ message NameEntry {
|
|||||||
NameRecord entry = 2;
|
NameRecord entry = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NameRecord
|
// NameRecord defines a versioned name record
|
||||||
message NameRecord {
|
message NameRecord {
|
||||||
NameRecordEntry latest = 1;
|
NameRecordEntry latest = 1;
|
||||||
repeated NameRecordEntry history = 2;
|
repeated NameRecordEntry history = 2;
|
||||||
@ -131,4 +131,4 @@ message BlockChangeSet {
|
|||||||
message AuctionBidInfo {
|
message AuctionBidInfo {
|
||||||
string auction_id = 1 [(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""];
|
string auction_id = 1 [(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""];
|
||||||
string bidder_address = 2 [(gogoproto.moretags) = "json:\"bidderAddress\" yaml:\"bidderAddress\""];
|
string bidder_address = 2 [(gogoproto.moretags) = "json:\"bidderAddress\" yaml:\"bidderAddress\""];
|
||||||
}
|
}
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
# Originally from: https://github.com/devcontainers/images/blob/main/src/javascript-node/.devcontainer/Dockerfile
|
|
||||||
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
|
|
||||||
ARG VARIANT=16-bullseye
|
|
||||||
FROM node:${VARIANT}
|
|
||||||
|
|
||||||
ARG USERNAME=node
|
|
||||||
ARG NPM_GLOBAL=/usr/local/share/npm-global
|
|
||||||
|
|
||||||
# Add NPM global to PATH.
|
|
||||||
ENV PATH=${NPM_GLOBAL}/bin:${PATH}
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
# Configure global npm install location, use group to adapt to UID/GID changes
|
|
||||||
if ! cat /etc/group | grep -e "^npm:" > /dev/null 2>&1; then groupadd -r npm; fi \
|
|
||||||
&& usermod -a -G npm ${USERNAME} \
|
|
||||||
&& umask 0002 \
|
|
||||||
&& mkdir -p ${NPM_GLOBAL} \
|
|
||||||
&& touch /usr/local/etc/npmrc \
|
|
||||||
&& chown ${USERNAME}:npm ${NPM_GLOBAL} /usr/local/etc/npmrc \
|
|
||||||
&& chmod g+s ${NPM_GLOBAL} \
|
|
||||||
&& npm config -g set prefix ${NPM_GLOBAL} \
|
|
||||||
&& su ${USERNAME} -c "npm config -g set prefix ${NPM_GLOBAL}" \
|
|
||||||
# Install eslint
|
|
||||||
&& su ${USERNAME} -c "umask 0002 && npm install -g eslint" \
|
|
||||||
&& npm cache clean --force > /dev/null 2>&1
|
|
||||||
|
|
||||||
# [Optional] Uncomment this section to install additional OS packages.
|
|
||||||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|
||||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
|
||||||
|
|
||||||
# [Optional] Uncomment if you want to install an additional version of node using nvm
|
|
||||||
# ARG EXTRA_NODE_VERSION=10
|
|
||||||
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
|
|
||||||
|
|
||||||
# [Optional] Uncomment if you want to install more global node modules
|
|
||||||
# RUN su node -c "npm install -g <your-package-list-here>"
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
COPY entrypoint.sh .
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
||||||
# Placeholder CMD : generally this will be overridden at run time like :
|
|
||||||
# docker run -it -v /home/builder/cerc/laconic-sdk:/workspace cerc/builder-js sh -c 'cd /workspace && yarn && yarn build'
|
|
||||||
CMD node --version
|
|
||||||
|
|
||||||
# Temp hack, clone the laconic-sdk repo here
|
|
||||||
WORKDIR /app
|
|
||||||
RUN \
|
|
||||||
git clone https://github.com/cerc-io/laconic-sdk.git \
|
|
||||||
&& cd laconic-sdk \
|
|
||||||
&& yarn install
|
|
||||||
|
|
||||||
WORKDIR /app/laconic-sdk
|
|
@ -1,3 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
docker build -t cerc-io/laconicd:local-test ../../
|
docker build -t cerc/laconicd:local ../.. --progress=plain
|
||||||
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
docker build -t cerc-io/laconic-sdk-tester:local-test -f Dockerfile-sdk .
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
|||||||
services:
|
|
||||||
laconicd:
|
|
||||||
restart: unless-stopped
|
|
||||||
image: cerc-io/laconicd:local-test
|
|
||||||
environment:
|
|
||||||
- TEST_AUCTION_ENABLED=true
|
|
||||||
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
|
||||||
volumes:
|
|
||||||
- ../../init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "curl", "-v", "http://127.0.0.1:6060"]
|
|
||||||
interval: 1s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 30
|
|
||||||
ports:
|
|
||||||
- "6060"
|
|
||||||
- "26657"
|
|
||||||
- "26656"
|
|
||||||
- "9473"
|
|
||||||
- "8545"
|
|
||||||
- "8546"
|
|
||||||
- "9090"
|
|
||||||
- "9091"
|
|
||||||
- "1317"
|
|
||||||
|
|
||||||
sdk-test-runner:
|
|
||||||
image: cerc-io/laconic-sdk-tester:local-test
|
|
||||||
depends_on:
|
|
||||||
laconicd:
|
|
||||||
condition: service_healthy
|
|
||||||
command: tail -F /dev/null
|
|
@ -1,31 +0,0 @@
|
|||||||
services:
|
|
||||||
laconicd:
|
|
||||||
restart: unless-stopped
|
|
||||||
image: cerc-io/laconicd:local-test
|
|
||||||
environment:
|
|
||||||
- TEST_REGISTRY_EXPIRY=true
|
|
||||||
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
|
||||||
volumes:
|
|
||||||
- ../../init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "curl", "-v", "http://127.0.0.1:6060"]
|
|
||||||
interval: 1s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 30
|
|
||||||
ports:
|
|
||||||
- "6060"
|
|
||||||
- "26657"
|
|
||||||
- "26656"
|
|
||||||
- "9473"
|
|
||||||
- "8545"
|
|
||||||
- "8546"
|
|
||||||
- "9090"
|
|
||||||
- "9091"
|
|
||||||
- "1317"
|
|
||||||
|
|
||||||
sdk-test-runner:
|
|
||||||
image: cerc-io/laconic-sdk-tester:local-test
|
|
||||||
depends_on:
|
|
||||||
laconicd:
|
|
||||||
condition: service_healthy
|
|
||||||
command: tail -F /dev/null
|
|
@ -1,10 +1,14 @@
|
|||||||
services:
|
services:
|
||||||
laconicd:
|
laconicd:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: cerc-io/laconicd:local-test
|
image: cerc/laconicd:local
|
||||||
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
entrypoint: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
||||||
|
environment:
|
||||||
|
- TEST_AUCTION_ENABLED
|
||||||
|
- TEST_REGISTRY_EXPIRY
|
||||||
|
- LOGLEVEL
|
||||||
volumes:
|
volumes:
|
||||||
- ../../init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
- ../../init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-v", "http://127.0.0.1:6060"]
|
test: ["CMD", "curl", "-v", "http://127.0.0.1:6060"]
|
||||||
interval: 1s
|
interval: 1s
|
||||||
@ -22,7 +26,7 @@ services:
|
|||||||
- "1317"
|
- "1317"
|
||||||
|
|
||||||
sdk-test-runner:
|
sdk-test-runner:
|
||||||
image: cerc-io/laconic-sdk-tester:local-test
|
image: cerc/laconic-sdk-tester:local
|
||||||
depends_on:
|
depends_on:
|
||||||
laconicd:
|
laconicd:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
exec "$@"
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
# Get the key from laconicd
|
|
||||||
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe )
|
|
||||||
# Set parameters for the test suite
|
|
||||||
cosmos_chain_id=laconic_9000-1
|
|
||||||
laconicd_rest_endpoint=http://laconicd:1317
|
|
||||||
laconicd_gql_endpoint=http://laconicd:9473/api
|
|
||||||
# Run tests
|
|
||||||
docker network inspect sdk_tests_default
|
|
||||||
sleep 30s
|
|
||||||
docker logs sdk_tests-laconicd-1
|
|
||||||
|
|
||||||
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:auctions"
|
|
@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
# Get the key from laconicd
|
|
||||||
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe )
|
|
||||||
# Set parameters for the test suite
|
|
||||||
cosmos_chain_id=laconic_9000-1
|
|
||||||
laconicd_rest_endpoint=http://laconicd:1317
|
|
||||||
laconicd_gql_endpoint=http://laconicd:9473/api
|
|
||||||
# Run tests
|
|
||||||
docker network inspect sdk_tests_default
|
|
||||||
sleep 30s
|
|
||||||
docker logs sdk_tests-laconicd-1
|
|
||||||
|
|
||||||
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:nameservice-expiry"
|
|
@ -1,17 +1,26 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Forwards all args to yarn on the sdk-test-runner container
|
||||||
|
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
yarn_args=("--inspect-brk=8888")
|
||||||
|
yarn_args+=("${@:-test}")
|
||||||
|
|
||||||
# Get the key from laconicd
|
# Get the key from laconicd
|
||||||
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe )
|
laconicd_key=$(
|
||||||
|
yes | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe
|
||||||
|
)
|
||||||
# Set parameters for the test suite
|
# Set parameters for the test suite
|
||||||
cosmos_chain_id=laconic_9000-1
|
cosmos_chain_id=laconic_9000-1
|
||||||
laconicd_rest_endpoint=http://laconicd:1317
|
laconicd_rest_endpoint=http://laconicd:1317
|
||||||
laconicd_gql_endpoint=http://laconicd:9473/api
|
laconicd_gql_endpoint=http://laconicd:9473/api
|
||||||
# Run tests
|
|
||||||
docker network inspect sdk_tests_default
|
|
||||||
docker compose 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 --retry 10 --retry-delay 3 --retry-connrefused 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"
|
# Run tests
|
||||||
|
docker compose exec \
|
||||||
|
-e COSMOS_CHAIN_ID="$cosmos_chain_id" \
|
||||||
|
-e LACONICD_REST_ENDPOINT="$laconicd_rest_endpoint" \
|
||||||
|
-e LACONICD_GQL_ENDPOINT="$laconicd_gql_endpoint" \
|
||||||
|
-e PRIVATE_KEY="$laconicd_key" \
|
||||||
|
sdk-test-runner yarn run "${yarn_args[@]}"
|
||||||
|
@ -519,6 +519,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
|
|||||||
|
|
||||||
l.Log("starting test network...")
|
l.Log("starting test network...")
|
||||||
for _, v := range network.Validators {
|
for _, v := range network.Validators {
|
||||||
|
l.Log("starting validator:", v.Moniker)
|
||||||
err := startInProcess(cfg, v)
|
err := startInProcess(cfg, v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
337
x/auction/types/tx.pb.gw.go
generated
337
x/auction/types/tx.pb.gw.go
generated
@ -1,337 +0,0 @@
|
|||||||
// 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
420
x/bond/types/tx.pb.gw.go
generated
@ -1,420 +0,0 @@
|
|||||||
// 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
|
|
||||||
)
|
|
@ -72,10 +72,6 @@ $ %s tx %s set [payload file path] [bond-id]
|
|||||||
}
|
}
|
||||||
|
|
||||||
msg := types.NewMsgSetRecord(payload, args[1], clientCtx.GetFromAddress())
|
msg := types.NewMsgSetRecord(payload, args[1], clientCtx.GetFromAddress())
|
||||||
err = msg.ValidateBasic()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
|
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,6 @@ 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()
|
||||||
@ -30,7 +28,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryParams() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqURL + badPath,
|
reqURL + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
@ -44,7 +42,8 @@ func (s *IntegrationTestSuite) TestGRPCQueryParams() {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
resp, err := rest.GetRequest(tc.url)
|
||||||
|
s.NoError(err)
|
||||||
require := s.Require()
|
require := s.Require()
|
||||||
if tc.expectErr {
|
if tc.expectErr {
|
||||||
require.Contains(string(resp), tc.errorMsg)
|
require.Contains(string(resp), tc.errorMsg)
|
||||||
@ -62,7 +61,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryParams() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint: all
|
// nolint: all
|
||||||
func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() {
|
func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
@ -77,7 +76,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + badPath,
|
reqUrl + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
@ -112,11 +111,11 @@ func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
if !tc.expectErr {
|
tc.preRun(authorityName)
|
||||||
tc.preRun(authorityName)
|
tc.url = fmt.Sprintf(tc.url, authorityName)
|
||||||
tc.url = fmt.Sprintf(tc.url, authorityName)
|
|
||||||
}
|
resp, err := rest.GetRequest(tc.url)
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
s.NoError(err)
|
||||||
require := s.Require()
|
require := s.Require()
|
||||||
if tc.expectErr {
|
if tc.expectErr {
|
||||||
require.Contains(string(resp), tc.errorMsg)
|
require.Contains(string(resp), tc.errorMsg)
|
||||||
@ -133,7 +132,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() {
|
|||||||
func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
|
func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
reqURL := val.APIAddress + "/vulcanize/registry/v1beta1/lookup?crn=%s"
|
reqURL := val.APIAddress + "/vulcanize/registry/v1beta1/lookup"
|
||||||
authorityName := "QueryLookUp"
|
authorityName := "QueryLookUp"
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
@ -145,7 +144,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqURL + badPath,
|
reqURL + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
@ -153,7 +152,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Success",
|
"Success",
|
||||||
reqURL,
|
fmt.Sprintf(reqURL+"?crn=crn://%s/", authorityName),
|
||||||
false,
|
false,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
@ -165,11 +164,9 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
if !tc.expectErr {
|
tc.preRun(authorityName)
|
||||||
tc.preRun(authorityName)
|
resp, err := rest.GetRequest(tc.url)
|
||||||
tc.url = fmt.Sprintf(reqURL, fmt.Sprintf("crn://%s/", authorityName))
|
s.NoError(err)
|
||||||
}
|
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
|
||||||
if tc.expectErr {
|
if tc.expectErr {
|
||||||
sr.Contains(string(resp), tc.errorMsg)
|
sr.Contains(string(resp), tc.errorMsg)
|
||||||
} else {
|
} else {
|
||||||
@ -182,7 +179,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint: all
|
// nolint: all
|
||||||
func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
|
func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
@ -197,7 +194,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + badPath,
|
reqUrl + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
@ -235,12 +232,11 @@ func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
if !tc.expectErr {
|
tc.preRun(s.bondID)
|
||||||
tc.preRun(s.bondID)
|
|
||||||
}
|
|
||||||
// wait 12 seconds for records expires
|
// wait 12 seconds for records expires
|
||||||
time.Sleep(time.Second * 12)
|
time.Sleep(time.Second * 12)
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
resp, err := rest.GetRequest(tc.url)
|
||||||
|
s.NoError(err)
|
||||||
require := s.Require()
|
require := s.Require()
|
||||||
if tc.expectErr {
|
if tc.expectErr {
|
||||||
require.Contains(string(resp), tc.errorMsg)
|
require.Contains(string(resp), tc.errorMsg)
|
||||||
@ -254,7 +250,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint: all
|
// nolint: all
|
||||||
func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
|
func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
@ -269,7 +265,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + badPath,
|
reqUrl + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
@ -305,13 +301,12 @@ func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
if !tc.expectErr {
|
tc.preRun("QueryAuthorityExpiryQueue")
|
||||||
tc.preRun("QueryAuthorityExpiryQueue")
|
|
||||||
}
|
|
||||||
// wait 12 seconds to name authorites expires
|
// wait 12 seconds to name authorites expires
|
||||||
time.Sleep(time.Second * 12)
|
time.Sleep(time.Second * 12)
|
||||||
|
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
resp, err := rest.GetRequest(tc.url)
|
||||||
|
s.NoError(err)
|
||||||
require := s.Require()
|
require := s.Require()
|
||||||
if tc.expectErr {
|
if tc.expectErr {
|
||||||
require.Contains(string(resp), tc.errorMsg)
|
require.Contains(string(resp), tc.errorMsg)
|
||||||
@ -326,7 +321,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint: all
|
// nolint: all
|
||||||
func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
|
func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
@ -341,7 +336,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + badPath,
|
reqUrl + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
@ -379,10 +374,9 @@ func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
if !tc.expectErr {
|
tc.preRun(s.bondID)
|
||||||
tc.preRun(s.bondID)
|
resp, err := rest.GetRequest(tc.url)
|
||||||
}
|
s.NoError(err)
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
|
||||||
require := s.Require()
|
require := s.Require()
|
||||||
if tc.expectErr {
|
if tc.expectErr {
|
||||||
require.Contains(string(resp), tc.errorMsg)
|
require.Contains(string(resp), tc.errorMsg)
|
||||||
@ -411,7 +405,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByID() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqURL + badPath,
|
reqURL + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) string {
|
func(bondId string) string {
|
||||||
@ -445,12 +439,11 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByID() {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
var recordID string
|
recordID := tc.preRun(s.bondID)
|
||||||
if !tc.expectErr {
|
tc.url = fmt.Sprintf(reqURL, recordID)
|
||||||
recordID = tc.preRun(s.bondID)
|
|
||||||
tc.url = fmt.Sprintf(reqURL, recordID)
|
resp, err := rest.GetRequest(tc.url)
|
||||||
}
|
s.NoError(err)
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
|
||||||
require := s.Require()
|
require := s.Require()
|
||||||
if tc.expectErr {
|
if tc.expectErr {
|
||||||
require.Contains(string(resp), tc.errorMsg)
|
require.Contains(string(resp), tc.errorMsg)
|
||||||
@ -480,7 +473,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByBondID() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqURL + badPath,
|
reqURL + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
@ -500,11 +493,11 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByBondID() {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
if !tc.expectErr {
|
tc.preRun(s.bondID)
|
||||||
tc.preRun(s.bondID)
|
tc.url = fmt.Sprintf(reqURL, s.bondID)
|
||||||
tc.url = fmt.Sprintf(reqURL, s.bondID)
|
|
||||||
}
|
resp, err := rest.GetRequest(tc.url)
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
s.NoError(err)
|
||||||
require := s.Require()
|
require := s.Require()
|
||||||
if tc.expectErr {
|
if tc.expectErr {
|
||||||
require.Contains(string(resp), tc.errorMsg)
|
require.Contains(string(resp), tc.errorMsg)
|
||||||
@ -534,7 +527,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRegistryModuleBalance() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqURL + badPath,
|
reqURL + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
@ -554,10 +547,9 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRegistryModuleBalance() {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
if !tc.expectErr {
|
tc.preRun(s.bondID)
|
||||||
tc.preRun(s.bondID)
|
resp, err := rest.GetRequest(tc.url)
|
||||||
}
|
s.NoError(err)
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
|
||||||
require := s.Require()
|
require := s.Require()
|
||||||
if tc.expectErr {
|
if tc.expectErr {
|
||||||
require.Contains(string(resp), tc.errorMsg)
|
require.Contains(string(resp), tc.errorMsg)
|
||||||
@ -585,7 +577,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryNamesList() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqURL + badPath,
|
reqURL + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
@ -605,10 +597,9 @@ func (s *IntegrationTestSuite) TestGRPCQueryNamesList() {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
if !tc.expectErr {
|
tc.preRun("ListNameRecords")
|
||||||
tc.preRun("ListNameRecords")
|
resp, err := rest.GetRequest(tc.url)
|
||||||
}
|
s.NoError(err)
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
|
||||||
require := s.Require()
|
require := s.Require()
|
||||||
if tc.expectErr {
|
if tc.expectErr {
|
||||||
require.Contains(string(resp), tc.errorMsg)
|
require.Contains(string(resp), tc.errorMsg)
|
||||||
@ -645,5 +636,5 @@ func createRecord(bondID string, s *IntegrationTestSuite) {
|
|||||||
var d sdk.TxResponse
|
var d sdk.TxResponse
|
||||||
err = val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &d)
|
err = val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &d)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.Zero(d.Code)
|
sr.Zero(d.Code, d.RawLog)
|
||||||
}
|
}
|
||||||
|
@ -538,9 +538,6 @@ func createNameRecord(authorityName string, s *IntegrationTestSuite) {
|
|||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.Zero(d.Code)
|
sr.Zero(d.Code)
|
||||||
|
|
||||||
// creating the bond
|
|
||||||
CreateBond(s)
|
|
||||||
|
|
||||||
// Get the bond-id
|
// Get the bond-id
|
||||||
bondID := GetBondID(s)
|
bondID := GetBondID(s)
|
||||||
|
|
||||||
|
@ -101,42 +101,23 @@ func CreateBond(s *IntegrationTestSuite) {
|
|||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
|
|
||||||
testCases := []struct {
|
clientCtx := val.ClientCtx
|
||||||
name string
|
cmd := bondcli.NewCreateBondCmd()
|
||||||
args []string
|
args := []string{
|
||||||
err bool
|
fmt.Sprintf("100000000000%s", s.cfg.BondDenom),
|
||||||
}{
|
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
||||||
{
|
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||||
"create bond",
|
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock),
|
||||||
[]string{
|
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
||||||
fmt.Sprintf("100000000000%s", s.cfg.BondDenom),
|
fmt.Sprintf("--%s=%s", flags.FlagFees, fmt.Sprintf("3%s", s.cfg.BondDenom)),
|
||||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
|
||||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
|
||||||
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock),
|
|
||||||
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
|
||||||
fmt.Sprintf("--%s=%s", flags.FlagFees, fmt.Sprintf("3%s", s.cfg.BondDenom)),
|
|
||||||
},
|
|
||||||
false,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, args)
|
||||||
|
sr.NoError(err)
|
||||||
|
|
||||||
for _, tc := range testCases {
|
var d sdk.TxResponse
|
||||||
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
err = val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &d)
|
||||||
clientCtx := val.ClientCtx
|
sr.NoError(err)
|
||||||
cmd := bondcli.NewCreateBondCmd()
|
sr.Zero(d.Code)
|
||||||
|
|
||||||
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)
|
|
||||||
if tc.err {
|
|
||||||
sr.Error(err)
|
|
||||||
} else {
|
|
||||||
sr.NoError(err)
|
|
||||||
var d sdk.TxResponse
|
|
||||||
err = val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &d)
|
|
||||||
sr.NoError(err)
|
|
||||||
sr.Zero(d.Code)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetBondID(s *IntegrationTestSuite) string {
|
func GetBondID(s *IntegrationTestSuite) string {
|
||||||
@ -160,6 +141,11 @@ func (s *IntegrationTestSuite) TestGetCmdSetRecord() {
|
|||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
|
|
||||||
|
bondID := GetBondID(s)
|
||||||
|
dir, err := os.Getwd()
|
||||||
|
sr.NoError(err)
|
||||||
|
payloadPath := dir + "/service_provider_example.yml"
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
args []string
|
args []string
|
||||||
@ -179,6 +165,7 @@ func (s *IntegrationTestSuite) TestGetCmdSetRecord() {
|
|||||||
{
|
{
|
||||||
"success",
|
"success",
|
||||||
[]string{
|
[]string{
|
||||||
|
payloadPath, bondID,
|
||||||
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),
|
||||||
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
||||||
@ -191,17 +178,6 @@ func (s *IntegrationTestSuite) TestGetCmdSetRecord() {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
||||||
if !tc.err {
|
|
||||||
// create the bond
|
|
||||||
CreateBond(s)
|
|
||||||
// get the bond id from bond list
|
|
||||||
bondID := GetBondID(s)
|
|
||||||
dir, err := os.Getwd()
|
|
||||||
sr.NoError(err)
|
|
||||||
payloadPath := dir + "/service_provider_example.yml"
|
|
||||||
|
|
||||||
tc.args = append([]string{payloadPath, bondID}, tc.args...)
|
|
||||||
}
|
|
||||||
clientCtx := val.ClientCtx
|
clientCtx := val.ClientCtx
|
||||||
cmd := cli.GetCmdSetRecord()
|
cmd := cli.GetCmdSetRecord()
|
||||||
|
|
||||||
@ -341,9 +317,6 @@ func (s *IntegrationTestSuite) TestGetCmdSetName() {
|
|||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.Zero(d.Code)
|
sr.Zero(d.Code)
|
||||||
|
|
||||||
// creating the bond
|
|
||||||
CreateBond(s)
|
|
||||||
|
|
||||||
// Get the bond-id
|
// Get the bond-id
|
||||||
bondID := GetBondID(s)
|
bondID := GetBondID(s)
|
||||||
|
|
||||||
@ -369,9 +342,7 @@ func (s *IntegrationTestSuite) TestGetCmdSetName() {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
||||||
if !tc.err {
|
tc.preRun(authorityName)
|
||||||
tc.preRun(authorityName)
|
|
||||||
}
|
|
||||||
|
|
||||||
clientCtx := val.ClientCtx
|
clientCtx := val.ClientCtx
|
||||||
cmd := cli.GetCmdSetName()
|
cmd := cli.GetCmdSetName()
|
||||||
@ -394,6 +365,7 @@ func (s *IntegrationTestSuite) TestGetCmdSetAuthorityBond() {
|
|||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
authorityName := "TestGetCmdSetAuthorityBond"
|
authorityName := "TestGetCmdSetAuthorityBond"
|
||||||
|
bondID := GetBondID(s)
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
@ -417,6 +389,7 @@ func (s *IntegrationTestSuite) TestGetCmdSetAuthorityBond() {
|
|||||||
{
|
{
|
||||||
"success with name and bond-id",
|
"success with name and bond-id",
|
||||||
[]string{
|
[]string{
|
||||||
|
authorityName, bondID,
|
||||||
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),
|
||||||
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
||||||
@ -449,15 +422,7 @@ func (s *IntegrationTestSuite) TestGetCmdSetAuthorityBond() {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
||||||
if !tc.err {
|
tc.preRun(authorityName)
|
||||||
// reserve the name
|
|
||||||
tc.preRun(authorityName)
|
|
||||||
// creating the bond
|
|
||||||
CreateBond(s)
|
|
||||||
// getting the bond-id
|
|
||||||
bondID := GetBondID(s)
|
|
||||||
tc.args = append([]string{authorityName, bondID}, tc.args...)
|
|
||||||
}
|
|
||||||
clientCtx := val.ClientCtx
|
clientCtx := val.ClientCtx
|
||||||
cmd := cli.GetCmdSetAuthorityBond()
|
cmd := cli.GetCmdSetAuthorityBond()
|
||||||
|
|
||||||
@ -501,6 +466,7 @@ func (s *IntegrationTestSuite) TestGetCmdDeleteName() {
|
|||||||
{
|
{
|
||||||
"successfully delete name",
|
"successfully delete name",
|
||||||
[]string{
|
[]string{
|
||||||
|
fmt.Sprintf("crn://%s/", authorityName),
|
||||||
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),
|
||||||
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
||||||
@ -516,10 +482,8 @@ func (s *IntegrationTestSuite) TestGetCmdDeleteName() {
|
|||||||
|
|
||||||
for _, tc := range testCasesForDeletingName {
|
for _, tc := range testCasesForDeletingName {
|
||||||
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
||||||
if !tc.err {
|
tc.preRun(authorityName, s)
|
||||||
tc.preRun(authorityName, s)
|
|
||||||
tc.args = append([]string{fmt.Sprintf("crn://%s/", authorityName)}, tc.args...)
|
|
||||||
}
|
|
||||||
clientCtx := val.ClientCtx
|
clientCtx := val.ClientCtx
|
||||||
cmd := cli.GetCmdDeleteName()
|
cmd := cli.GetCmdDeleteName()
|
||||||
|
|
||||||
@ -574,8 +538,6 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
|||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
func(s *IntegrationTestSuite) string {
|
func(s *IntegrationTestSuite) string {
|
||||||
// create the bond
|
|
||||||
CreateBond(s)
|
|
||||||
// get the bond id from bond list
|
// get the bond id from bond list
|
||||||
bondID := GetBondID(s)
|
bondID := GetBondID(s)
|
||||||
dir, err := os.Getwd()
|
dir, err := os.Getwd()
|
||||||
@ -816,8 +778,6 @@ func (s *IntegrationTestSuite) TestGetCmdAssociateBond() {
|
|||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
func(s *IntegrationTestSuite) (string, string) {
|
func(s *IntegrationTestSuite) (string, string) {
|
||||||
// create the bond
|
|
||||||
CreateBond(s)
|
|
||||||
// get the bond id from bond list
|
// get the bond id from bond list
|
||||||
bondID := GetBondID(s)
|
bondID := GetBondID(s)
|
||||||
dir, err := os.Getwd()
|
dir, err := os.Getwd()
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
record:
|
|
||||||
type: GeneralRecord
|
|
||||||
name: foo
|
|
||||||
version: 1.0.0
|
|
||||||
tags:
|
|
||||||
- tagA
|
|
||||||
- tagB
|
|
@ -3,12 +3,12 @@ package keeper_test
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
"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() {
|
||||||
@ -39,7 +39,6 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
examples := []string{
|
examples := []string{
|
||||||
"/../helpers/examples/service_provider_example.yml",
|
"/../helpers/examples/service_provider_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
|
||||||
@ -60,7 +59,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
®istrytypes.QueryListRecordsRequest{},
|
®istrytypes.QueryListRecordsRequest{},
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
3,
|
2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Filter with type",
|
"Filter with type",
|
||||||
@ -80,60 +79,6 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
false,
|
false,
|
||||||
1,
|
1,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"Filter with tag (extant) (https://git.vdb.to/cerc-io/laconicd/issues/129)",
|
|
||||||
®istrytypes.QueryListRecordsRequest{
|
|
||||||
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
|
||||||
{
|
|
||||||
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",
|
"Filter with attributes ServiceProviderRegistration",
|
||||||
®istrytypes.QueryListRecordsRequest{
|
®istrytypes.QueryListRecordsRequest{
|
||||||
@ -178,7 +123,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 && test.noOfRecords > 0 {
|
if test.createRecords {
|
||||||
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())
|
||||||
@ -188,25 +133,10 @@ 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() {
|
||||||
av := keeper.GetAttributeValue(attr.Value)
|
if attr.Key[:4] == "x500" {
|
||||||
if nil != av && nil != recAttr[attr.Key] &&
|
sr.Equal(keeper.GetAttributeValue(attr.Value), recAttr["x500"].(map[string]interface{})[attr.Key[4:]])
|
||||||
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 {
|
} else {
|
||||||
if attr.Key[:4] == "x500" {
|
sr.Equal(keeper.GetAttributeValue(attr.Value), recAttr[attr.Key])
|
||||||
sr.Equal(av, recAttr["x500"].(map[string]interface{})[attr.Key[4:]])
|
|
||||||
} else {
|
|
||||||
sr.Equal(av, recAttr[attr.Key])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -21,7 +20,6 @@ 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 (
|
||||||
@ -98,11 +96,6 @@ 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)...)
|
||||||
@ -263,13 +256,13 @@ func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*type
|
|||||||
pubKey, err := legacy.PubKeyFromBytes(helpers.BytesFromBase64(sig.PubKey))
|
pubKey, err := legacy.PubKeyFromBytes(helpers.BytesFromBase64(sig.PubKey))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error decoding pubKey from bytes: ", err)
|
fmt.Println("Error decoding pubKey from bytes: ", err)
|
||||||
return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "Invalid public key.")
|
return nil, errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "Invalid public key: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
sigOK := pubKey.VerifySignature(resourceSignBytes, helpers.BytesFromBase64(sig.Sig))
|
sigOK := pubKey.VerifySignature(resourceSignBytes, helpers.BytesFromBase64(sig.Sig))
|
||||||
if !sigOK {
|
if !sigOK {
|
||||||
fmt.Println("Signature mismatch: ", sig.PubKey)
|
fmt.Println("Signature mismatch: ", sig.PubKey)
|
||||||
return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "Invalid signature.")
|
return nil, errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "Invalid signature: %s", sig.PubKey)
|
||||||
}
|
}
|
||||||
record.Owners = append(record.Owners, pubKey.Address().String())
|
record.Owners = append(record.Owners, pubKey.Address().String())
|
||||||
}
|
}
|
||||||
@ -345,26 +338,13 @@ func (k Keeper) ProcessAttributes(ctx sdk.Context, record types.RecordType) erro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "WebsiteRegistrationRecord", "ApplicationRecord", "ApplicationDeploymentRequest",
|
case "WebsiteRegistrationRecord":
|
||||||
"ApplicationDeploymentRecord", "ApplicationArtifact", "ApplicationDeploymentRemovalRequest",
|
|
||||||
"ApplicationDeploymentRemovalRecord", "DnsRecord", "GeneralRecord":
|
|
||||||
{
|
{
|
||||||
// #nosec G705
|
// #nosec G705
|
||||||
for key := range record.Attributes {
|
for key := range record.Attributes {
|
||||||
attr := record.Attributes[key]
|
indexKey := GetAttributesIndexKey(key, record.Attributes[key])
|
||||||
if reflect.Slice == reflect.TypeOf(attr).Kind() {
|
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
||||||
av := attr.([]interface{})
|
return err
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -381,7 +361,7 @@ func (k Keeper) ProcessAttributes(ctx sdk.Context, record types.RecordType) erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
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)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,8 +389,7 @@ 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) {
|
||||||
k.Logger(ctx).Debug(fmt.Sprintf("store doesn't have key: %q", key))
|
return nil, nil
|
||||||
return []string{}, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var recordIds []string
|
var recordIds []string
|
||||||
|
@ -25,11 +25,7 @@ func (m msgServer) SetRecord(c context.Context, msg *types.MsgSetRecord) (*types
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
record, err := m.Keeper.ProcessSetRecord(ctx, types.MsgSetRecord{
|
record, err := m.Keeper.ProcessSetRecord(ctx, *msg)
|
||||||
BondId: msg.GetBondId(),
|
|
||||||
Signer: msg.GetSigner(),
|
|
||||||
Payload: msg.GetPayload(),
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -51,7 +47,7 @@ func (m msgServer) SetRecord(c context.Context, msg *types.MsgSetRecord) (*types
|
|||||||
return &types.MsgSetRecordResponse{Id: record.ID}, nil
|
return &types.MsgSetRecordResponse{Id: record.ID}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint: all
|
// nolint: all
|
||||||
func (m msgServer) SetName(c context.Context, msg *types.MsgSetName) (*types.MsgSetNameResponse, error) {
|
func (m msgServer) SetName(c context.Context, msg *types.MsgSetName) (*types.MsgSetNameResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
||||||
@ -108,7 +104,7 @@ func (m msgServer) ReserveName(c context.Context, msg *types.MsgReserveAuthority
|
|||||||
return &types.MsgReserveAuthorityResponse{}, nil
|
return &types.MsgReserveAuthorityResponse{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint: all
|
// nolint: all
|
||||||
func (m msgServer) SetAuthorityBond(c context.Context, msg *types.MsgSetAuthorityBond) (*types.MsgSetAuthorityBondResponse, error) {
|
func (m msgServer) SetAuthorityBond(c context.Context, msg *types.MsgSetAuthorityBond) (*types.MsgSetAuthorityBondResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
||||||
@ -185,7 +181,7 @@ func (m msgServer) RenewRecord(c context.Context, msg *types.MsgRenewRecord) (*t
|
|||||||
return &types.MsgRenewRecordResponse{}, nil
|
return &types.MsgRenewRecordResponse{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint: all
|
// nolint: all
|
||||||
func (m msgServer) AssociateBond(c context.Context, msg *types.MsgAssociateBond) (*types.MsgAssociateBondResponse, error) {
|
func (m msgServer) AssociateBond(c context.Context, msg *types.MsgAssociateBond) (*types.MsgAssociateBondResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
||||||
|
4936
x/registry/types/attributes.pb.go
generated
4936
x/registry/types/attributes.pb.go
generated
File diff suppressed because it is too large
Load Diff
@ -50,54 +50,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|||||||
(*Attributes)(nil),
|
(*Attributes)(nil),
|
||||||
&WebsiteRegistrationRecord{},
|
&WebsiteRegistrationRecord{},
|
||||||
)
|
)
|
||||||
|
|
||||||
registry.RegisterInterface(
|
|
||||||
"vulcanize.registry.v1beta1.ApplicationRecord",
|
|
||||||
(*Attributes)(nil),
|
|
||||||
&ApplicationRecord{},
|
|
||||||
)
|
|
||||||
|
|
||||||
registry.RegisterInterface(
|
|
||||||
"vulcanize.registry.v1beta1.ApplicationDeploymentRequest",
|
|
||||||
(*Attributes)(nil),
|
|
||||||
&ApplicationDeploymentRequest{},
|
|
||||||
)
|
|
||||||
|
|
||||||
registry.RegisterInterface(
|
|
||||||
"vulcanize.registry.v1beta1.ApplicationDeploymentRecord",
|
|
||||||
(*Attributes)(nil),
|
|
||||||
&ApplicationDeploymentRecord{},
|
|
||||||
)
|
|
||||||
|
|
||||||
registry.RegisterInterface(
|
|
||||||
"vulcanize.registry.v1beta1.ApplicationArtifact",
|
|
||||||
(*Attributes)(nil),
|
|
||||||
&ApplicationArtifact{},
|
|
||||||
)
|
|
||||||
|
|
||||||
registry.RegisterInterface(
|
|
||||||
"vulcanize.registry.v1beta1.ApplicationDeploymentRemovalRequest",
|
|
||||||
(*Attributes)(nil),
|
|
||||||
&ApplicationDeploymentRemovalRequest{},
|
|
||||||
)
|
|
||||||
|
|
||||||
registry.RegisterInterface(
|
|
||||||
"vulcanize.registry.v1beta1.ApplicationDeploymentRemovalRecord",
|
|
||||||
(*Attributes)(nil),
|
|
||||||
&ApplicationDeploymentRemovalRecord{},
|
|
||||||
)
|
|
||||||
|
|
||||||
registry.RegisterInterface(
|
|
||||||
"vulcanize.registry.v1beta1.DnsRecord",
|
|
||||||
(*Attributes)(nil),
|
|
||||||
&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
918
x/registry/types/tx.pb.gw.go
generated
@ -1,918 +0,0 @@
|
|||||||
// 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
|
|
||||||
)
|
|
@ -68,78 +68,6 @@ func payLoadAttributes(recordPayLoad map[string]interface{}) (*codectypes.Any, e
|
|||||||
}
|
}
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
}
|
}
|
||||||
case "ApplicationRecord":
|
|
||||||
{
|
|
||||||
var attributes ApplicationRecord
|
|
||||||
err := json.Unmarshal(bz, &attributes)
|
|
||||||
if err != nil {
|
|
||||||
return &codectypes.Any{}, err
|
|
||||||
}
|
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
|
||||||
}
|
|
||||||
case "ApplicationDeploymentRequest":
|
|
||||||
{
|
|
||||||
var attributes ApplicationDeploymentRequest
|
|
||||||
err := json.Unmarshal(bz, &attributes)
|
|
||||||
if err != nil {
|
|
||||||
return &codectypes.Any{}, err
|
|
||||||
}
|
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
|
||||||
}
|
|
||||||
case "ApplicationDeploymentRecord":
|
|
||||||
{
|
|
||||||
var attributes ApplicationDeploymentRecord
|
|
||||||
err := json.Unmarshal(bz, &attributes)
|
|
||||||
if err != nil {
|
|
||||||
return &codectypes.Any{}, err
|
|
||||||
}
|
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
|
||||||
}
|
|
||||||
case "ApplicationDeploymentRemovalRequest":
|
|
||||||
{
|
|
||||||
var attributes ApplicationDeploymentRemovalRequest
|
|
||||||
err := json.Unmarshal(bz, &attributes)
|
|
||||||
if err != nil {
|
|
||||||
return &codectypes.Any{}, err
|
|
||||||
}
|
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
|
||||||
}
|
|
||||||
case "ApplicationDeploymentRemovalRecord":
|
|
||||||
{
|
|
||||||
var attributes ApplicationDeploymentRemovalRecord
|
|
||||||
err := json.Unmarshal(bz, &attributes)
|
|
||||||
if err != nil {
|
|
||||||
return &codectypes.Any{}, err
|
|
||||||
}
|
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
|
||||||
}
|
|
||||||
case "ApplicationArtifact":
|
|
||||||
{
|
|
||||||
var attributes ApplicationArtifact
|
|
||||||
err := json.Unmarshal(bz, &attributes)
|
|
||||||
if err != nil {
|
|
||||||
return &codectypes.Any{}, err
|
|
||||||
}
|
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
|
||||||
}
|
|
||||||
case "DnsRecord":
|
|
||||||
{
|
|
||||||
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)
|
|
||||||
if err != nil {
|
|
||||||
return &codectypes.Any{}, err
|
|
||||||
}
|
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
return &codectypes.Any{}, fmt.Errorf("unsupported record type %s", recordType.(string))
|
return &codectypes.Any{}, fmt.Errorf("unsupported record type %s", recordType.(string))
|
||||||
}
|
}
|
||||||
@ -207,110 +135,6 @@ func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) {
|
|||||||
panic("Proto unmarshal error")
|
panic("Proto unmarshal error")
|
||||||
}
|
}
|
||||||
|
|
||||||
bz, err = json.Marshal(attributes)
|
|
||||||
if err != nil {
|
|
||||||
panic("JSON marshal error")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case "ApplicationRecord":
|
|
||||||
{
|
|
||||||
var attributes ApplicationRecord
|
|
||||||
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 "ApplicationDeploymentRequest":
|
|
||||||
{
|
|
||||||
var attributes ApplicationDeploymentRequest
|
|
||||||
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 "ApplicationDeploymentRecord":
|
|
||||||
{
|
|
||||||
var attributes ApplicationDeploymentRecord
|
|
||||||
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 "ApplicationDeploymentRemovalRequest":
|
|
||||||
{
|
|
||||||
var attributes ApplicationDeploymentRemovalRequest
|
|
||||||
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 "ApplicationDeploymentRemovalRecord":
|
|
||||||
{
|
|
||||||
var attributes ApplicationDeploymentRemovalRecord
|
|
||||||
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 "ApplicationArtifact":
|
|
||||||
{
|
|
||||||
var attributes ApplicationArtifact
|
|
||||||
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 "DnsRecord":
|
|
||||||
{
|
|
||||||
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)
|
|
||||||
if err != nil {
|
|
||||||
panic("Proto unmarshal error")
|
|
||||||
}
|
|
||||||
|
|
||||||
bz, err = json.Marshal(attributes)
|
bz, err = json.Marshal(attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("JSON marshal error")
|
panic("JSON marshal error")
|
||||||
|
Loading…
Reference in New Issue
Block a user