Skip to content

Commit

Permalink
Merge branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybxyz committed Apr 21, 2021
2 parents b664a65 + ee1aa8b commit f018a6b
Show file tree
Hide file tree
Showing 689 changed files with 2,564 additions and 352,156 deletions.
49 changes: 48 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop'"

build:
runs-on: ubuntu-latest
strategy:
matrix:
go-arch: ["amd64", "arm64"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2.1.3
with:
go-version: 1.15
- uses: technote-space/get-diff-action@v4
id: git_diff
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: Build
run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make build

test-coverage:
runs-on: ubuntu-latest
Expand All @@ -24,7 +44,7 @@ jobs:
- uses: actions/setup-go@v2.1.3
with:
go-version: 1.15
- name: Display go version
- name: display go version
run: go version
- name: test & coverage report creation
run: make test-cover
Expand All @@ -43,6 +63,33 @@ jobs:
with:
file: ./coverage.txt

test-race:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2.1.3
with:
go-version: 1.15
- name: display go version
run: go version
- name: test & coverage report creation
run: make test-race
- name: filter out DONTCOVER
run: |
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
excludelist+=" $(find ./ -type f -name '*.pb.go')"
excludelist+=" $(find ./ -type f -name '*.pb.gw.go')"
excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')"
for filename in ${excludelist}; do
filename=$(echo $filename | sed 's/^./github.com\/tendermint\/liquidity/g')
echo "Excluding ${filename} from coverage report..."
sed -i "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
done
- uses: codecov/codecov-action@v1.0.14
with:
file: ./coverage.txt

test-simulation:
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down
24 changes: 9 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
PACKAGES_NOSIMULATION=$(shell go list ./...)
PACKAGES_NOSIMULATION=$(shell go list ./... | grep -v '/simulation')
BINDIR ?= $(GOPATH)/bin
SIMAPP = ./app

Expand Down Expand Up @@ -81,13 +81,6 @@ endif
build-linux: go.sum
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build

build-contract-tests-hooks:
ifeq ($(OS),Windows_NT)
go build -mod=readonly $(BUILD_FLAGS) -o build/contract_tests.exe ./cmd/contract_tests
else
go build -mod=readonly $(BUILD_FLAGS) -o build/contract_tests ./cmd/contract_tests
endif

install: go.sum
go install $(BUILD_FLAGS) ./cmd/liquidityd

Expand Down Expand Up @@ -131,14 +124,14 @@ update-swagger-docs: statik
test: test-unit
test-all: test-unit test-race test-cover

test-unit:
@VERSION=$(VERSION) go test -mod=readonly $(PACKAGES_NOSIMULATION)
test-unit:
@VERSION=$(VERSION) go test -mod=readonly -tags='norace' $(PACKAGES_NOSIMULATION)

test-race:
@VERSION=$(VERSION) go test -mod=readonly -race $(PACKAGES_NOSIMULATION)
@go test -mod=readonly -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock' ./...

test-cover:
@go test -mod=readonly -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock' ./...
@go test -mod=readonly -timeout 30m -coverprofile=coverage.txt -covermode=atomic -tags='norace ledger test_ledger_mock' ./...

test-build: build
@go test -mod=readonly -p 4 `go list ./cli_test/...` -tags=cli_test -v
Expand Down Expand Up @@ -214,12 +207,13 @@ format:
### Protobuf ###
###############################################################################

proto-all: proto-tools proto-gen proto-swagger-gen
proto-all: proto-gen proto-swagger-gen

proto-gen:
@./scripts/protocgen.sh
docker run --rm -v $(CURDIR):/workspace --workdir /workspace bharvest/liquidity-proto-gen sh ./scripts/protocgen.sh
go mod tidy

proto-swagger-gen:
@./scripts/protoc-swagger-gen.sh
docker run --rm -v $(CURDIR):/workspace --workdir /workspace bharvest/liquidity-proto-gen sh ./scripts/protoc-swagger-gen.sh

.PHONY: proto-all proto-gen proto-swagger-gen
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ For detailed Mechanism, you can find on our recent [Paper](doc/LiquidityModuleLi
| Requirement | Notes |
| ----------- | ---------------- |
| Go version | Go1.15 or higher |
| Cosmos-SDK | v0.42.1 |
| Cosmos-SDK | v0.42.4 |

### Get Liquidity Module source code
```bash
Expand Down Expand Up @@ -76,9 +76,9 @@ Usage:
liquidityd tx liquidity [command]

Available Commands:
create-pool Create new liquidity pool with the specified pool type and deposit coins
deposit Deposit coins to the specified liquidity pool
swap Swap offer coin with demand coin from the specified liquidity pool with the given order price
create-pool Create liquidity pool and deposit coins
deposit Deposit coins to a liquidity pool
swap Swap offer coin with demand coin from the liquidity pool with the given order price
withdraw Withdraw pool coin from the specified liquidity pool
```

Expand All @@ -96,16 +96,16 @@ Usage:
liquidityd query liquidity [command]

Available Commands:
batch Query details of a liquidity pool batch of the pool
deposit Query for the deposit message on the batch of the liquidity pool specified pool-id and msg-index
deposits Query for all deposit messages on the batch of the liquidity pool specified pool-id
params Query the current liquidity parameters information
batch Query details of a liquidity pool batch
deposit Query the deposit messages on the liquidity pool batch
deposits Query all deposit messages of the liquidity pool batch
params Query the values set as liquidity parameters
pool Query details of a liquidity pool
pools Query for all liquidity pools
swap Query for the swap message on the batch of the liquidity pool specified pool-id and msg-index
swaps Query for all swap messages on the batch of the liquidity pool specified pool-id
withdraw Query for the withdraw message on the batch of the liquidity pool specified pool-id and msg-index
withdraws Query for all withdraw messages on the batch of the liquidity pool specified pool-id
swaps Query all swap messages in the liquidity pool batch
withdraw Query the withdraw messages in the liquidity pool batch
withdraws Query for all withdraw messages on the liquidity pool batch
```

#### A detailed document on client can be found here. [client.md](doc/client.md)
Expand Down
8 changes: 5 additions & 3 deletions client/docs/statik/statik.go

Large diffs are not rendered by default.

Loading

0 comments on commit f018a6b

Please sign in to comment.