Skip to content

Commit 4c7ce6b

Browse files
committed
Fixed examples
1 parent 40dc55b commit 4c7ce6b

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

.make/Makefile.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,17 @@ test-short: ## Runs vet, lint and tests (excludes integration tests)
6262

6363
test-travis: ## Runs all tests via Travis (also exports coverage)
6464
@$(MAKE) lint
65-
@echo "running tests..."
65+
@echo "running tests (travis)..."
6666
@go test ./... -race -coverprofile=coverage.txt -covermode=atomic
6767

68+
test-travis-no-race: ## Runs all tests (no race) (also exports coverage)
69+
@$(MAKE) lint
70+
@echo "running tests (no race)..."
71+
@go test ./... -coverprofile=coverage.txt -covermode=atomic
72+
6873
test-travis-short: ## Runs unit tests via Travis (also exports coverage)
6974
@$(MAKE) lint
70-
@echo "running tests (short)..."
75+
@echo "running tests (short & travis)..."
7176
@go test ./... -test.short -race -coverprofile=coverage.txt -covermode=atomic
7277

7378
uninstall: ## Uninstall the application (and remove files)

examples/address_from_private_key/address_from_private_key.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
func main() {
1010

1111
// Start with a private key (we will make one for this example)
12-
privateKey, err := bitcoin.CreatePrivateKeyString()
12+
privateKey, err := bitcoin.CreatePrivateKey()
1313
if err != nil {
1414
log.Fatalf("error occurred: %s", err.Error())
1515
}

examples/script_from_address/script_from_address.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
func main() {
1010
// Start with a private key (we will make one for this example)
11-
privateKey, err := bitcoin.CreatePrivateKeyString()
11+
privateKey, err := bitcoin.CreatePrivateKey()
1212
if err != nil {
1313
log.Fatalf("error occurred: %s", err.Error())
1414
}

examples/verify_signature/verify_signature.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ func main() {
1313
signature := "H/sEz5QDQYkXCox9shPB4MMVAVUM/JzfbPHNpPRwNl+hMI2gxy3x7xs9Ed5ryuny5s2hY4Qxc5uirqjMyEEON6k="
1414
message := "This is the example message"
1515

16+
rawKey, err := bitcoin.PrivateKeyFromString(privateKey)
17+
if err != nil {
18+
log.Fatalf("error occurred: %s", err.Error())
19+
}
20+
1621
// Get an address from private key
17-
address, err := bitcoin.GetAddressFromPrivateKey(privateKey, true)
22+
var address string
23+
address, err = bitcoin.GetAddressFromPrivateKey(rawKey, true)
1824
if err != nil {
1925
log.Fatalf("error occurred: %s", err.Error())
2026
}

0 commit comments

Comments
 (0)