Skip to content

Commit 442bed7

Browse files
committed
add pkg makefile
1 parent 4e38315 commit 442bed7

File tree

2 files changed

+29
-32
lines changed

2 files changed

+29
-32
lines changed

pkg/Makefile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
PWD := $(shell pwd)
2+
GOPATH := $(shell go env GOPATH)
3+
4+
all: build
5+
6+
all: getdeps test
7+
8+
getdeps:
9+
@echo "Installing golangci-lint" && go get github.com/golangci/golangci-lint/cmd/golangci-lint && go install github.com/golangci/golangci-lint/cmd/golangci-lint
10+
@echo "Installing zbusc" && go install github.com/threefoldtech/zbus/zbusc
11+
go mod tidy
12+
13+
lint:
14+
@echo "Running $@"
15+
@${GOPATH}/bin/golangci-lint run -c ../.golangci.yml
16+
17+
check: test
18+
test: lint build
19+
go test -vet=off -v $(shell go list ./... | grep -Ev "stubs|network" )
20+
21+
testrace: lint build
22+
go test -vet=off -v $(shell go list ./... | grep -Ev "stubs|network" )
23+
24+
generate:
25+
@echo "Generating modules client stubs"
26+
go generate github.com/threefoldtech/zosbase/pkg
27+
28+
build:
29+
@CGO_ENABLED=0 go build -v ./...

pkg/registrar_gateway/registrar_gateway.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -288,35 +288,3 @@ func (r *registrarGateway) SetNodePowerState(up bool) (hash subTypes.Hash, err e
288288
// return g.sub.SetNodePowerState(g.identity, up)
289289
return subTypes.Hash{}, nil
290290
}
291-
292-
func buildSubstrateError(err error) (serr pkg.SubstrateError) {
293-
if err == nil {
294-
return
295-
}
296-
297-
serr.Err = err
298-
serr.Code = pkg.CodeGenericError
299-
300-
if errors.Is(err, substrate.ErrNotFound) {
301-
serr.Code = pkg.CodeNotFound
302-
} else if errors.Is(err, substrate.ErrBurnTransactionNotFound) {
303-
serr.Code = pkg.CodeBurnTransactionNotFound
304-
} else if errors.Is(err, substrate.ErrRefundTransactionNotFound) {
305-
serr.Code = pkg.CodeRefundTransactionNotFound
306-
} else if errors.Is(err, substrate.ErrFailedToDecode) {
307-
serr.Code = pkg.CodeFailedToDecode
308-
} else if errors.Is(err, substrate.ErrInvalidVersion) {
309-
serr.Code = pkg.CodeInvalidVersion
310-
} else if errors.Is(err, substrate.ErrUnknownVersion) {
311-
serr.Code = pkg.CodeUnknownVersion
312-
} else if errors.Is(err, substrate.ErrIsUsurped) {
313-
serr.Code = pkg.CodeIsUsurped
314-
} else if errors.Is(err, substrate.ErrAccountNotFound) {
315-
serr.Code = pkg.CodeAccountNotFound
316-
} else if errors.Is(err, substrate.ErrDepositFeeNotFound) {
317-
serr.Code = pkg.CodeDepositFeeNotFound
318-
} else if errors.Is(err, substrate.ErrMintTransactionNotFound) {
319-
serr.Code = pkg.CodeMintTransactionNotFound
320-
}
321-
return
322-
}

0 commit comments

Comments
 (0)