Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update deps #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Test
on: [push, pull_request]
jobs:
build:
name: Go CI
runs-on: ubuntu-latest
strategy:
matrix:
go: [1.14, 1.15]
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Check out source
uses: actions/checkout@v2
- name: Install Linters
run: "curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.33.0"
- name: Build
env:
GO111MODULE: "on"
run: go build ./...
- name: Test
env:
GO111MODULE: "on"
run: go test ./...
- name: Lint
env:
GO111MODULE: "on"
run: |
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.

5 changes: 2 additions & 3 deletions cmd/dcrtumble/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ import (
"runtime"
"strings"

"github.com/decred/dcrd/dcrutil"
"github.com/decred/dcrd/dcrutil/v3"
"github.com/decred/tumblebit/netparams"

flags "github.com/jessevdk/go-flags"
)

Expand Down Expand Up @@ -209,7 +208,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
5 changes: 2 additions & 3 deletions cmd/dcrtumble/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ import (
"path/filepath"
"strings"

"google.golang.org/grpc"
"google.golang.org/grpc/credentials"

"github.com/decred/tumblebit/netparams"
"github.com/decred/tumblebit/wallet"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
)

var activeNet = &netparams.MainNetParams
Expand Down
13 changes: 7 additions & 6 deletions cmd/dcrtumble/puzzles.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ 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/dcrd/dcrec/secp256k1/v3/ecdsa"
"github.com/decred/tumblebit/puzzle"
"github.com/decred/tumblebit/shuffle"
)
Expand Down Expand Up @@ -259,7 +260,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 +277,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 +325,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 := ecdsa.ParseDERSignature(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
4 changes: 2 additions & 2 deletions cmd/dcrtumble/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"errors"
"fmt"

"github.com/decred/dcrd/dcrutil"
"github.com/decred/dcrd/dcrutil/v3"
"github.com/decred/tumblebit/contract"
"github.com/decred/tumblebit/wallet"
)
Expand All @@ -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 nil, fmt.Errorf("Failed to obtain an address for escrow: %v", err)
}

escrow, err := tb.SetupEscrow(ctx, &EscrowRequest{
Expand Down
3 changes: 1 addition & 2 deletions cmd/dcrtumble/tumbler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import (
"context"
"fmt"

"github.com/decred/dcrd/chaincfg"
"github.com/decred/dcrd/chaincfg/v3"
pb "github.com/decred/tumblebit/rpc/tumblerrpc"

"google.golang.org/grpc"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/dcrtumble/txscript.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package main

import (
"github.com/decred/dcrd/txscript"
"github.com/decred/dcrd/txscript/v3"
"github.com/decred/tumblebit/contract"
)

Expand Down
Loading