Compare commits
2 commits
tcl/master
...
feature/ad
Author | SHA1 | Date | |
---|---|---|---|
2c92802c53 | |||
1fcaba319e |
4 changed files with 43 additions and 6 deletions
36
.forgejo/workflows/tests.yml
Normal file
36
.forgejo/workflows/tests.yml
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
name: Tests and linters
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: '1.19'
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: golangci-lint
|
||||||
|
uses: https://github.com/golangci/golangci-lint-action@v3
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
|
||||||
|
tests:
|
||||||
|
name: Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: '1.19'
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: make test
|
||||||
|
|
9
Makefile
9
Makefile
|
@ -26,14 +26,15 @@ image:
|
||||||
@echo Version: $(VERSION)
|
@echo Version: $(VERSION)
|
||||||
docker build -t $(LEGO_IMAGE) .
|
docker build -t $(LEGO_IMAGE) .
|
||||||
|
|
||||||
test: clean
|
test:
|
||||||
go test -v -cover ./...
|
@echo "⇒ Running go test"
|
||||||
|
@go test ./... -count=1
|
||||||
|
|
||||||
e2e: clean
|
e2e: clean
|
||||||
LEGO_E2E_TESTS=local go test -count=1 -v ./e2e/...
|
LEGO_E2E_TESTS=local go test -count=1 -v ./e2e/...
|
||||||
|
|
||||||
checks:
|
lint:
|
||||||
golangci-lint run
|
@golangci-lint --timeout=5m run
|
||||||
|
|
||||||
# Release helper
|
# Release helper
|
||||||
.PHONY: patch minor major detach
|
.PHONY: patch minor major detach
|
||||||
|
|
|
@ -21,7 +21,7 @@ const (
|
||||||
// TLSALPN01 is the "tls-alpn-01" ACME challenge https://www.rfc-editor.org/rfc/rfc8737.html
|
// TLSALPN01 is the "tls-alpn-01" ACME challenge https://www.rfc-editor.org/rfc/rfc8737.html
|
||||||
TLSALPN01 = Type("tls-alpn-01")
|
TLSALPN01 = Type("tls-alpn-01")
|
||||||
|
|
||||||
// NNS01 is the "nns-01" ACME challenge
|
// NNS01 is the "nns-01" ACME challenge.
|
||||||
NNS01 = Type("nns-01")
|
NNS01 = Type("nns-01")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ func NewNNSProvider(nnsServer string, walletFile string, accountAddress string,
|
||||||
return nil, fmt.Errorf("retrieve wallet from file: %w", err)
|
return nil, fmt.Errorf("retrieve wallet from file: %w", err)
|
||||||
}
|
}
|
||||||
var address util.Uint160
|
var address util.Uint160
|
||||||
if len(accountAddress) == 0 {
|
if accountAddress == "" {
|
||||||
address = w.GetChangeAddress()
|
address = w.GetChangeAddress()
|
||||||
} else {
|
} else {
|
||||||
address, err = flags.ParseAddress(accountAddress)
|
address, err = flags.ParseAddress(accountAddress)
|
||||||
|
|
Loading…
Reference in a new issue