Skip to content

Commit

Permalink
build: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
dajohi committed Mar 3, 2020
1 parent 31898ba commit 73eee85
Show file tree
Hide file tree
Showing 19 changed files with 312 additions and 305 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and Test
on: [push, pull_request]
jobs:
build:
name: Go CI
runs-on: ubuntu-latest
strategy:
matrix:
go: [1.13, 1.14]
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
- name: Check out source
uses: actions/checkout@v1
- name: Install Linters
run: "curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.6"
- name: Build
env:
GO111MODULE: "on"
run: go build ./...
- name: Test
env:
GO111MODULE: "on"
run: go test ./...
- name: Lint
env:
GO111MODULE: "on"
run: |
export PATH=${PATH}:$(go env GOPATH)/bin
golangci-lint run --disable-all --deadline=10m --enable=gofmt --enable=gosimple --enable=unconvert --enable=ineffassign --enable=govet
176 changes: 0 additions & 176 deletions Gopkg.lock

This file was deleted.

57 changes: 0 additions & 57 deletions Gopkg.toml

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/dcrtumble/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func loadConfig() (*config, []string, error) {
// Multiple networks can't be selected simultaneously.
numNets := 0
if cfg.TestNet {
activeNet = &netparams.TestNet2Params
activeNet = &netparams.TestNet3Params
numNets++
}
if cfg.SimNet {
Expand Down
12 changes: 6 additions & 6 deletions cmd/dcrtumble/puzzles.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"math/big"
mrand "math/rand"

"github.com/decred/dcrd/chaincfg/chainec"
"github.com/decred/dcrd/chaincfg/chainhash"
"github.com/decred/dcrd/dcrec/secp256k1/v3"
"github.com/decred/tumblebit/puzzle"
"github.com/decred/tumblebit/shuffle"
)
Expand Down Expand Up @@ -259,7 +259,7 @@ func validatePuzzlePromiseResponse(c *puzzlePromiseChallenge, r *puzzlePromiseRe

for i, j := range fakeTxList {
if !puzzle.ValidatePuzzle(&pkey, r.puzzles[j], r.secrets[i]) {
errors.New("obtained secrets didn't verify")
return errors.New("obtained secrets didn't verify")
}
sig, err := puzzle.RevealSolution(r.promises[j], r.secrets[i])
if err != nil {
Expand All @@ -276,7 +276,7 @@ func validatePuzzlePromiseResponse(c *puzzlePromiseChallenge, r *puzzlePromiseRe
realPuzzles[i] = r.puzzles[idx]
}
if !puzzle.VerifyQuotients(&pkey, r.quotients, realPuzzles) {
errors.New("failed to verify quotients")
return errors.New("failed to verify quotients")
}

return nil
Expand Down Expand Up @@ -324,15 +324,15 @@ out:
}

func verifySignature(sigBytes []byte, hash []byte, publicKey []byte) error {
pubkey, err := chainec.Secp256k1.ParsePubKey(publicKey)
pubkey, err := secp256k1.ParsePubKey(publicKey)
if err != nil {
return err
}
sig, err := chainec.Secp256k1.ParseSignature(sigBytes)
sig, err := secp256k1.ParseSignature(sigBytes)
if err != nil {
return err
}
if !chainec.Secp256k1.Verify(pubkey, hash, sig.GetR(), sig.GetS()) {
if !sig.Verify(hash, pubkey) {
return errors.New("failed to verify the signature")
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion cmd/dcrtumble/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (tb *Tumbler) NewEscrow(ctx context.Context, w *wallet.Wallet) (*PaymentPuz

recvAddr, recvPubKey, err := w.GetExtAddress(ctx)
if err != nil {
fmt.Errorf("Failed to obtain an address for escrow: %v", err)
return fmt.Errorf("Failed to obtain an address for escrow: %v", err)
}

escrow, err := tb.SetupEscrow(ctx, &EscrowRequest{
Expand Down
6 changes: 3 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"sort"
"strings"

"github.com/btcsuite/btclog"
"github.com/decred/dcrd/dcrutil"
"github.com/decred/slog"
"github.com/decred/tumblebit/internal/cfgutil"
"github.com/decred/tumblebit/netparams"
"github.com/decred/tumblebit/tumbler"
Expand Down Expand Up @@ -127,7 +127,7 @@ func cleanAndExpandPath(path string) string {

// validLogLevel returns whether or not logLevel is a valid debug log level.
func validLogLevel(logLevel string) bool {
_, ok := btclog.LevelFromString(logLevel)
_, ok := slog.LevelFromString(logLevel)
return ok
}

Expand Down Expand Up @@ -300,7 +300,7 @@ func loadConfig(ctx context.Context) (*config, []string, error) {
// Multiple networks can't be selected simultaneously.
numNets := 0
if cfg.TestNet {
activeNet = &netparams.TestNet2Params
activeNet = &netparams.TestNet3Params
numNets++
}
if cfg.SimNet {
Expand Down
Loading

0 comments on commit 73eee85

Please sign in to comment.