Skip to content

Commit

Permalink
refactor: devtool: re-generate all
Browse files Browse the repository at this point in the history
  • Loading branch information
dtynn committed Jan 21, 2022
1 parent b24b4e0 commit 6ccbdeb
Show file tree
Hide file tree
Showing 7 changed files with 341 additions and 356 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/baisc_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,15 @@ jobs:
- name: tests-shared
run: make test-venus-shared

- name: compatible-checks
- name: compatible all
run: |
make compatible-all
git --no-pager diff
git --no-pager diff --quiet
- name: check api docs
- name: gen all
run: |
make api-docs
git --no-pager diff
git --no-pager diff --quiet
make gen-all
- name: check cbor-gen
- name: detect changes
run: |
make cborgen
git --no-pager diff
git --no-pager diff --quiet
- name: check mock pai
run: |
make mock-api-gen
git --no-pager diff
git --no-pager diff --quiet
git status --porcelain
test -z "$(git status --porcelain)"
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ clean:
rm -rf ./extern/filecoin-ffi
rm -rf ./extern/test-vectors

gen-all: cborgen gogen inline-gen api-gen api-docs-gen

gen-asset:
go-bindata -pkg=asset -o ./fixtures/asset/asset.go ./fixtures/_assets/car/ ./fixtures/_assets/proof-params/ ./fixtures/_assets/arch-diagram.monopic
gofmt -s -l -w ./fixtures/asset/asset.go
Expand All @@ -45,14 +47,12 @@ inline-gen:
test-venus-shared:
cd venus-shared && go test -covermode=set ./...

gen-api:
cd ./venus-devtool/ && go run ./api-gen/
gofmt -s -l -w ./venus-shared/api/chain/v0/proxy_gen.go;
gofmt -s -l -w ./venus-shared/api/chain/v1/proxy_gen.go
api-gen:
cd ./venus-devtool/ && go run ./api-gen/ proxy

v0APIDoc = ../venus-shared/api/v0-api-document.md
v1APIDoc = ../venus-shared/api/v1-api-document.md
api-docs:
api-docs-gen:
cd ./venus-devtool/ && go run ./api-docs-gen/cmd ../venus-shared/api/chain/v0/fullnode.go FullNode v0 ../venus-shared/api/chain/v0 $(v0APIDoc)
cd ./venus-devtool/ && go run ./api-docs-gen/cmd ../venus-shared/api/chain/v1/fullnode.go FullNode v1 ../venus-shared/api/chain/v1 $(v1APIDoc)

Expand Down
2 changes: 1 addition & 1 deletion venus-devtool/api-gen/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func writeStruct(dst *bytes.Buffer, ifaceMeta *util.InterfaceMeta, astMeta *util
return fmt.Errorf("write func %s: %w", meth.Name, err)
}

fmt.Fprintf(dst, " `perm:%s`\n", util.GetAPIMethodPerm(meth))
fmt.Fprintf(dst, " `perm:\"%s\"`\n", util.GetAPIMethodPerm(meth))
}

fmt.Fprint(dst, structInternalTail)
Expand Down
2 changes: 0 additions & 2 deletions venus-shared/api/chain/v0/fullnode.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package v0

//go:generate go run github.com/golang/mock/[email protected] -destination=./mock/full.go -package=mock . FullNode

type FullNode interface {
IBlockStore
IChain
Expand Down
326 changes: 163 additions & 163 deletions venus-shared/api/chain/v0/proxy_gen.go

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions venus-shared/api/chain/v1/fullnode.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package v1

//go:generate go run github.com/golang/mock/[email protected] -destination=./mock/full.go -package=mock . FullNode

type FullNode interface {
IBlockStore
IChain
Expand Down
332 changes: 166 additions & 166 deletions venus-shared/api/chain/v1/proxy_gen.go

Large diffs are not rendered by default.

0 comments on commit 6ccbdeb

Please sign in to comment.