-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add codespace to broadcast response (#6) * chore: expose usedCodes for document (#7) * fix: query error (#9) * fix: check internalABCICodespace (#10) * fix: check UndefinedCodespace too * Update types/errors/abci.go Co-authored-by: Yongwoo Lee <[email protected]> Co-authored-by: Yongwoo Lee <[email protected]> * fix: Send response with 404 status when quering non-exist account (#14) * chore: enable github action ci * chore: remove github access token from Dockerfile Co-authored-by: Yongwoo Lee <[email protected]> Co-authored-by: Marshall Kim <[email protected]> Co-authored-by: wonkuk_seo <[email protected]>
- Loading branch information
1 parent
78226eb
commit 19d6caf
Showing
18 changed files
with
209 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ name: Lint | |
# Lint runs golangci-lint over the entire cosmos-sdk repository | ||
# This workflow is run on every pull request and push to master | ||
# The `golangci` will pass without running if no *.{go, mod, sum} files have been changed. | ||
env: | ||
GOPRIVATE: "github.com/line/*" | ||
on: | ||
pull_request: | ||
push: | ||
|
@@ -13,6 +15,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 6 | ||
steps: | ||
- name: Configure git for private modules | ||
env: | ||
TOKEN: ${{ secrets.TOKEN }} | ||
run: git config --global url."https://${TOKEN}:[email protected]".insteadOf "https://github.com" | ||
- uses: actions/checkout@v2 | ||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
name: Sims | ||
# Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short) | ||
# This workflow will run on all Pull Requests, if a .go, .mod or .sum file have been changed | ||
env: | ||
GOPRIVATE: "github.com/line/*" | ||
|
||
# TODO ebony: fix sim test failure | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
# pull_request: | ||
# push: | ||
# branches: | ||
# - master | ||
|
||
jobs: | ||
cleanup-runs: | ||
|
@@ -14,12 +18,16 @@ jobs: | |
steps: | ||
- uses: rokroskar/workflow-run-cleanup-action@master | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
GITHUB_TOKEN: "${{ secrets.TOKEN }}" | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, 'skip-sims')" | ||
steps: | ||
- name: Configure git for private modules | ||
env: | ||
TOKEN: ${{ secrets.TOKEN }} | ||
run: git config --global url."https://${TOKEN}:[email protected]".insteadOf "https://github.com" | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
|
@@ -48,6 +56,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: [build, install-runsim] | ||
steps: | ||
- name: Configure git for private modules | ||
env: | ||
TOKEN: ${{ secrets.TOKEN }} | ||
run: git config --global url."https://${TOKEN}:[email protected]".insteadOf "https://github.com" | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
|
@@ -74,6 +86,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: [build, install-runsim] | ||
steps: | ||
- name: Configure git for private modules | ||
env: | ||
TOKEN: ${{ secrets.TOKEN }} | ||
run: git config --global url."https://${TOKEN}:[email protected]".insteadOf "https://github.com" | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
name: Tests / Code Coverage | ||
# Tests / Code Coverage workflow runs unit tests and uploads a code coverage report | ||
# This workflow is run on pushes to master & every Pull Requests where a .go, .mod, .sum have been changed | ||
env: | ||
GOPRIVATE: "github.com/line/*" | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
@@ -12,7 +15,7 @@ jobs: | |
steps: | ||
- uses: rokroskar/workflow-run-cleanup-action@master | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
GITHUB_TOKEN: "${{ secrets.TOKEN }}" | ||
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'" | ||
|
||
install-tparse: | ||
|
@@ -37,6 +40,10 @@ jobs: | |
matrix: | ||
go-arch: ["amd64", "arm", "arm64"] | ||
steps: | ||
- name: Configure git for private modules | ||
env: | ||
TOKEN: ${{ secrets.TOKEN }} | ||
run: git config --global url."https://${TOKEN}:[email protected]".insteadOf "https://github.com" | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
|
@@ -54,6 +61,10 @@ jobs: | |
test-cosmovisor: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Configure git for private modules | ||
env: | ||
TOKEN: ${{ secrets.TOKEN }} | ||
run: git config --global url."https://${TOKEN}:[email protected]".insteadOf "https://github.com" | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
|
@@ -76,6 +87,10 @@ jobs: | |
split-test-files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Configure git for private modules | ||
env: | ||
TOKEN: ${{ secrets.TOKEN }} | ||
run: git config --global url."https://${TOKEN}:[email protected]".insteadOf "https://github.com" | ||
- uses: actions/checkout@v2 | ||
- name: Create a file with all the pkgs | ||
run: go list ./... > pkgs.txt | ||
|
@@ -107,6 +122,10 @@ jobs: | |
matrix: | ||
part: ["00", "01", "02", "03"] | ||
steps: | ||
- name: Configure git for private modules | ||
env: | ||
TOKEN: ${{ secrets.TOKEN }} | ||
run: git config --global url."https://${TOKEN}:[email protected]".insteadOf "https://github.com" | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
|
@@ -185,6 +204,10 @@ jobs: | |
matrix: | ||
part: ["00", "01", "02", "03"] | ||
steps: | ||
- name: Configure git for private modules | ||
env: | ||
TOKEN: ${{ secrets.TOKEN }} | ||
run: git config --global url."https://${TOKEN}:[email protected]".insteadOf "https://github.com" | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
|
@@ -246,35 +269,41 @@ jobs: | |
run: cat ./*-race-output.txt | ~/go/bin/tparse | ||
if: env.GIT_DIFF | ||
|
||
liveness-test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.15 | ||
- uses: technote-space/get-diff-action@v4 | ||
id: git_diff | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- name: start localnet | ||
run: | | ||
make clean build-simd-linux localnet-start | ||
if: env.GIT_DIFF | ||
- name: test liveness | ||
run: | | ||
./contrib/localnet_liveness.sh 100 5 50 localhost | ||
if: env.GIT_DIFF | ||
# TODO ebony: enable this test | ||
# liveness-test: | ||
# runs-on: ubuntu-latest | ||
# timeout-minutes: 10 | ||
# steps: | ||
# - name: Configure git for private modules | ||
# env: | ||
# TOKEN: ${{ secrets.TOKEN }} | ||
# run: git config --global url."https://${TOKEN}:[email protected]".insteadOf "https://github.com" | ||
# - uses: actions/checkout@v2 | ||
# - uses: actions/[email protected] | ||
# with: | ||
# go-version: 1.15 | ||
# - uses: technote-space/get-diff-action@v4 | ||
# id: git_diff | ||
# with: | ||
# PATTERNS: | | ||
# **/**.go | ||
# go.mod | ||
# go.sum | ||
# - name: start localnet | ||
# run: | | ||
# make clean build-simd-linux localnet-start | ||
# if: env.GIT_DIFF | ||
# - name: test liveness | ||
# run: | | ||
# ./contrib/localnet_liveness.sh 100 5 50 localhost | ||
# if: env.GIT_DIFF | ||
|
||
docker-build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: build docker image | ||
run: | | ||
docker build --pull --rm -f "Dockerfile" -t simapp:latest "." | ||
# TODO ebony: fix module download error in docker | ||
# docker-build: | ||
# runs-on: ubuntu-latest | ||
# timeout-minutes: 10 | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: build docker image | ||
# run: | | ||
# docker build --pull --rm -f "Dockerfile" -t simapp:latest "." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package client | ||
|
||
import ( | ||
"bytes" | ||
"encoding/json" | ||
"strings" | ||
|
||
"github.com/pkg/errors" | ||
) | ||
|
||
type Error struct { | ||
Codespace string `json:"codespace"` | ||
Code uint32 `json:"code"` | ||
Message string `json:"message"` | ||
} | ||
|
||
func NewQueryError(codespace string, code uint32, desc string) *Error { | ||
return &Error{Codespace: codespace, Code: code, Message: desc} | ||
} | ||
|
||
func (err Error) Error() string { | ||
var buff bytes.Buffer | ||
enc := json.NewEncoder(&buff) | ||
enc.SetEscapeHTML(false) | ||
|
||
if err := enc.Encode(err); err != nil { | ||
panic(errors.Wrap(err, "failed to encode Query error log")) | ||
} | ||
|
||
return strings.TrimSpace(buff.String()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/line/lbm-sdk/cosmovisor | ||
module github.com/line/lbm-sdk/v2/cosmovisor | ||
|
||
go 1.14 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package errors | ||
|
||
func RegisteredErrors() []*Error { | ||
es := make([]*Error, 0, len(usedCodes)) | ||
for _, e := range usedCodes { | ||
es = append(es, e) | ||
} | ||
return es | ||
} |
Oops, something went wrong.