From 73eee85ccf1b8980fd2ba87f81bea5d448434ceb Mon Sep 17 00:00:00 2001 From: David Hill Date: Thu, 29 Aug 2019 18:18:06 -0400 Subject: [PATCH] build: update deps --- .github/workflows/go.yml | 32 +++++++ Gopkg.lock | 176 ---------------------------------- Gopkg.toml | 57 ----------- cmd/dcrtumble/config.go | 2 +- cmd/dcrtumble/puzzles.go | 12 +-- cmd/dcrtumble/session.go | 2 +- config.go | 6 +- contract/contract.go | 17 ++-- contract/txscript.go | 13 +-- go.mod | 23 +++++ go.sum | 199 +++++++++++++++++++++++++++++++++++++++ log.go | 14 ++- netparams/params.go | 10 +- rpc/rpcserver/log.go | 11 +-- shuffle/shuffle.go | 2 +- tumbler/log.go | 10 +- tumbler/tumbler.go | 1 - tumbler/tumbler_test.go | 25 +++-- wallet/wallet.go | 5 +- 19 files changed, 312 insertions(+), 305 deletions(-) create mode 100644 .github/workflows/go.yml delete mode 100644 Gopkg.lock delete mode 100644 Gopkg.toml create mode 100644 go.mod create mode 100644 go.sum diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..22ddaf7 --- /dev/null +++ b/.github/workflows/go.yml @@ -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 diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 76d451a..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,176 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - branch = "master" - name = "github.com/agl/ed25519" - packages = [ - ".", - "edwards25519" - ] - revision = "5312a61534124124185d41f09206b9fef1d88403" - -[[projects]] - branch = "master" - name = "github.com/btcsuite/btclog" - packages = ["."] - revision = "84c8d2346e9fc8c7b947e243b9c24e6df9fd206a" - -[[projects]] - branch = "master" - name = "github.com/dchest/blake256" - packages = ["."] - revision = "dee3fe6eb0e98dc774a94fc231f85baf7c29d360" - -[[projects]] - branch = "master" - name = "github.com/decred/base58" - packages = ["."] - revision = "56c501706f00d9e1cfacee19a27117e12da24734" - -[[projects]] - branch = "master" - name = "github.com/decred/dcrd" - packages = [ - "blockchain", - "blockchain/internal/dbnamespace", - "blockchain/internal/progresslog", - "blockchain/stake", - "blockchain/stake/internal/dbnamespace", - "blockchain/stake/internal/ticketdb", - "blockchain/stake/internal/tickettreap", - "certgen", - "chaincfg", - "chaincfg/chainec", - "chaincfg/chainhash", - "database", - "dcrec/edwards", - "dcrec/secp256k1", - "dcrec/secp256k1/schnorr", - "dcrjson", - "dcrutil", - "txscript", - "wire" - ] - revision = "4e01f768cb28a138b1b51dc17f0de284703b5f7a" - -[[projects]] - branch = "master" - name = "github.com/decred/dcrwallet" - packages = [ - "internal/helpers", - "rpc/walletrpc", - "wallet/txrules" - ] - revision = "0eced173e139932cf270586cd34b73e35a03a798" - -[[projects]] - branch = "master" - name = "github.com/golang/protobuf" - packages = [ - "proto", - "ptypes", - "ptypes/any", - "ptypes/duration", - "ptypes/timestamp" - ] - revision = "e09c5db296004fbe3f74490e84dcd62c3c5ddb1b" - -[[projects]] - name = "github.com/jessevdk/go-flags" - packages = ["."] - revision = "96dc06278ce32a0e9d957d590bb987c81ee66407" - version = "v1.3.0" - -[[projects]] - branch = "master" - name = "github.com/jrick/logrotate" - packages = ["rotator"] - revision = "a93b200c26cbae3bb09dd0dc2c7c7fe1468a034a" - -[[projects]] - branch = "master" - name = "golang.org/x/crypto" - packages = [ - "blake2s", - "ripemd160" - ] - revision = "88942b9c40a4c9d203b82b3731787b672d6e809b" - -[[projects]] - branch = "master" - name = "golang.org/x/net" - packages = [ - "context", - "http2", - "http2/hpack", - "idna", - "internal/timeseries", - "lex/httplex", - "trace" - ] - revision = "6078986fec03a1dcc236c34816c71b0e05018fda" - -[[projects]] - name = "golang.org/x/text" - packages = [ - "collate", - "collate/build", - "internal/colltab", - "internal/gen", - "internal/tag", - "internal/triegen", - "internal/ucd", - "language", - "secure/bidirule", - "transform", - "unicode/bidi", - "unicode/cldr", - "unicode/norm", - "unicode/rangetable" - ] - revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" - version = "v0.3.0" - -[[projects]] - branch = "master" - name = "google.golang.org/genproto" - packages = ["googleapis/rpc/status"] - revision = "ab0870e398d5dd054b868c0db1481ab029b9a9f2" - -[[projects]] - name = "google.golang.org/grpc" - packages = [ - ".", - "balancer", - "balancer/base", - "balancer/roundrobin", - "codes", - "connectivity", - "credentials", - "encoding", - "encoding/proto", - "grpclb/grpc_lb_v1/messages", - "grpclog", - "internal", - "keepalive", - "metadata", - "naming", - "peer", - "resolver", - "resolver/dns", - "resolver/passthrough", - "stats", - "status", - "tap", - "transport" - ] - revision = "afc05b9e1d36f289ea16ba294894486a3e458246" - version = "v1.11.0" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - inputs-digest = "6ee188da658bd943c60f5a88185fb32cf796ba606ed88a50c6de173fe0407a7c" - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 9ecfaf4..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,57 +0,0 @@ -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" - - -[[constraint]] - branch = "master" - name = "github.com/btcsuite/btclog" - -[[constraint]] - branch = "master" - name = "github.com/decred/dcrd" - -[[constraint]] - branch = "master" - name = "github.com/decred/dcrwallet" - -[[constraint]] - branch = "master" - name = "github.com/golang/protobuf" - -[[constraint]] - name = "github.com/jessevdk/go-flags" - version = "1.3.0" - -[[constraint]] - branch = "master" - name = "github.com/jrick/logrotate" - -[[constraint]] - branch = "master" - name = "golang.org/x/crypto" - -[[constraint]] - branch = "master" - name = "golang.org/x/net" - -[[constraint]] - name = "google.golang.org/grpc" - version = "1.0.0" diff --git a/cmd/dcrtumble/config.go b/cmd/dcrtumble/config.go index b80de01..7ffab8a 100644 --- a/cmd/dcrtumble/config.go +++ b/cmd/dcrtumble/config.go @@ -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 { diff --git a/cmd/dcrtumble/puzzles.go b/cmd/dcrtumble/puzzles.go index 963ba38..f4fc144 100644 --- a/cmd/dcrtumble/puzzles.go +++ b/cmd/dcrtumble/puzzles.go @@ -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" ) @@ -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 { @@ -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 @@ -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 diff --git a/cmd/dcrtumble/session.go b/cmd/dcrtumble/session.go index da24a70..486a3e1 100644 --- a/cmd/dcrtumble/session.go +++ b/cmd/dcrtumble/session.go @@ -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{ diff --git a/config.go b/config.go index 30e21b9..7b6df70 100644 --- a/config.go +++ b/config.go @@ -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" @@ -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 } @@ -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 { diff --git a/contract/contract.go b/contract/contract.go index 96c2dfb..f77e620 100644 --- a/contract/contract.go +++ b/contract/contract.go @@ -11,7 +11,7 @@ import ( "fmt" "github.com/decred/dcrd/chaincfg" - "github.com/decred/dcrd/chaincfg/chainec" + "github.com/decred/dcrd/dcrec" "github.com/decred/dcrd/dcrutil" "github.com/decred/dcrd/wire" ) @@ -193,7 +193,7 @@ func checkAddressType(addr dcrutil.Address, allowed addressType) bool { case *dcrutil.AddressSecpPubKey: found = PayToPubKey case *dcrutil.AddressPubKeyHash: - if a.DSA(a.Net()) == chainec.ECTypeSecp256k1 { + if a.DSA(a.Net()) == dcrec.STEcdsaSecp256k1 { found = PayToPubKeyHash } case *dcrutil.AddressSecSchnorrPubKey: @@ -203,16 +203,15 @@ func checkAddressType(addr dcrutil.Address, allowed addressType) bool { default: return false } - if found&allowed != 0 { - return true - } - return false + return found&allowed != 0 } -func (c *Contract) String() string { - var str string +func (c *Contract) ParseRedeemTransaction(spenderTx []byte) error { + return nil +} - str = "Contract{ " +func (c *Contract) String() string { + str := "Contract{ " if len(c.EscrowScript) > 0 { str += "Escrow{ " if len(c.SenderAddrStr) > 0 { diff --git a/contract/txscript.go b/contract/txscript.go index 88fce2e..df8369a 100644 --- a/contract/txscript.go +++ b/contract/txscript.go @@ -10,23 +10,18 @@ import ( "errors" "fmt" + "decred.org/dcrwallet/wallet/txrules" "github.com/decred/dcrd/dcrutil" "github.com/decred/dcrd/txscript" "github.com/decred/dcrd/wire" - "github.com/decred/dcrwallet/wallet/txrules" ) const feePerKb = 1e5 -const verifyFlags = txscript.ScriptBip16 | - txscript.ScriptVerifyDERSignatures | - txscript.ScriptVerifyStrictEncoding | - txscript.ScriptVerifyMinimalData | - txscript.ScriptDiscourageUpgradableNops | +const verifyFlags = txscript.ScriptDiscourageUpgradableNops | txscript.ScriptVerifyCleanStack | txscript.ScriptVerifyCheckLockTimeVerify | txscript.ScriptVerifyCheckSequenceVerify | - txscript.ScriptVerifyLowS | txscript.ScriptVerifySHA256 func (con *Contract) AddEscrowScript() error { @@ -204,7 +199,7 @@ func (con *Contract) BuildRefundTx() error { dcrutil.Amount(tx.TxOut[0].Value)) } - txIn := wire.NewTxIn(&contractOutPoint, nil) + txIn := wire.NewTxIn(&contractOutPoint, 0, nil) txIn.Sequence = 0 tx.AddTxIn(txIn) @@ -318,7 +313,7 @@ func (con *Contract) BuildRedeemTx(sigScriptAddSize int) error { tx := wire.NewMsgTx() tx.LockTime = uint32(con.LockTime) - tx.AddTxIn(wire.NewTxIn(&contractOutPoint, nil)) + tx.AddTxIn(wire.NewTxIn(&contractOutPoint, 0, nil)) tx.AddTxOut(wire.NewTxOut(0, outScript)) // amount set below redeemSize := estimateRedeemSerializeSize(con.EscrowScript, tx.TxOut, sigScriptAddSize) diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..b78747d --- /dev/null +++ b/go.mod @@ -0,0 +1,23 @@ +module github.com/decred/tumblebit + +go 1.12 + +require ( + decred.org/dcrwallet v1.2.3-0.20200302213733-aa8e3c25d23c + github.com/decred/dcrd/certgen v1.1.0 + github.com/decred/dcrd/chaincfg v1.5.2 + github.com/decred/dcrd/chaincfg/chainhash v1.0.2 + github.com/decred/dcrd/dcrec v1.0.0 + github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200215031403-6b2ce76f0986 + github.com/decred/dcrd/dcrutil v1.4.0 + github.com/decred/dcrd/txscript v1.1.0 + github.com/decred/dcrd/wire v1.3.0 + github.com/decred/slog v1.0.0 + github.com/golang/protobuf v1.3.4 + github.com/jessevdk/go-flags v1.4.0 + github.com/jrick/logrotate v1.0.0 + golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 + golang.org/x/net v0.0.0-20200301022130-244492dfa37a + golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e + google.golang.org/grpc v1.27.1 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..2fc5f61 --- /dev/null +++ b/go.sum @@ -0,0 +1,199 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +decred.org/cspp v0.3.0/go.mod h1:UygjYilC94dER3BEU65Zzyoqy9ngJfWCD2rdJqvUs2A= +decred.org/dcrwallet v1.2.3-0.20200302213733-aa8e3c25d23c h1:I6jOOXOGUmu8Ys2DRzE4PV+6t8QFuC5rCN7HiB3TlUA= +decred.org/dcrwallet v1.2.3-0.20200302213733-aa8e3c25d23c/go.mod h1:fL/UGOgsBF25gzSTK6pnDyJ0DXZWKVW/cFfm880bLbQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= +github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= +github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= +github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dchest/blake256 v1.0.0 h1:6gUgI5MHdz9g0TdrgKqXsoDX+Zjxmm1Sc6OsoGru50I= +github.com/dchest/blake256 v1.0.0/go.mod h1:xXNWCE1jsAP8DAjP+rKw2MbeqLczjI3TRx2VK+9OEYY= +github.com/dchest/siphash v1.2.1/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4= +github.com/decred/base58 v1.0.0 h1:BVi1FQCThIjZ0ehG+I99NJ51o0xcc9A/fDKhmJxY6+w= +github.com/decred/base58 v1.0.0/go.mod h1:LLY1p5e3g91byL/UO1eiZaYd+uRoVRarybgcoymu9Ks= +github.com/decred/base58 v1.0.1/go.mod h1:H2ENcsJjye1G7CbRa67kV9OFaui0LGr56ntKKoY5g9c= +github.com/decred/base58 v1.0.2 h1:yupIH6bg+q7KYfBk7oUv3xFjKGb5Ypm4+v/61X4keGY= +github.com/decred/base58 v1.0.2/go.mod h1:pXP9cXCfM2sFLb2viz2FNIdeMWmZDBKG3ZBYbiSM78E= +github.com/decred/dcrd/addrmgr v1.1.0/go.mod h1:exghL+0+QeVvO4MXezWJ1C2tcpBn3ngfuP6S1R+adB8= +github.com/decred/dcrd/blockchain/stake/v2 v2.0.0/go.mod h1:jv/rKMcZ87lhvVkHot/tElxeAYEUJ3mnKPHJ7WPq86U= +github.com/decred/dcrd/blockchain/stake/v2 v2.0.2/go.mod h1:o2TT/l/YFdrt15waUdlZ3g90zfSwlA0WgQqHV9UGJF4= +github.com/decred/dcrd/blockchain/stake/v3 v3.0.0-20200215031403-6b2ce76f0986/go.mod h1:aDL94kcVJfaaJP+acWUJrlK7g7xEOqTSiFe6bSN3yRQ= +github.com/decred/dcrd/blockchain/standalone v1.1.0 h1:yclvVGEY09Gf8A4GSAo+NCtL1dW2TYJ4OKp4+g0ICI0= +github.com/decred/dcrd/blockchain/standalone v1.1.0/go.mod h1:6K8ZgzlWM1Kz2TwXbrtiAvfvIwfAmlzrtpA7CVPCUPE= +github.com/decred/dcrd/blockchain/v3 v3.0.0-20200215045506-b2cef202a7cd/go.mod h1:R9rIXU8kEJVC9Z4LAlh9bo9hiT3a+ihys3mCrz4PVao= +github.com/decred/dcrd/certgen v1.1.0 h1:lAPE2OLYdYeXDCaji/+KC53j7/s7wF7RVGeQbXK//XA= +github.com/decred/dcrd/certgen v1.1.0/go.mod h1:ivkPLChfjdAgFh7ZQOtl6kJRqVkfrCq67dlq3AbZBQE= +github.com/decred/dcrd/chaincfg v1.5.1/go.mod h1:FukMzTjkwzjPU+hK7CqDMQe3NMbSZAYU5PAcsx1wlv0= +github.com/decred/dcrd/chaincfg v1.5.2 h1:dd6l9rqcpxg2GF5neBmE2XxRc5Lqda45fWmN4XOJRW8= +github.com/decred/dcrd/chaincfg v1.5.2/go.mod h1:FukMzTjkwzjPU+hK7CqDMQe3NMbSZAYU5PAcsx1wlv0= +github.com/decred/dcrd/chaincfg/chainhash v1.0.1/go.mod h1:OVfvaOsNLS/A1y4Eod0Ip/Lf8qga7VXCQjUQLbkY0Go= +github.com/decred/dcrd/chaincfg/chainhash v1.0.2 h1:rt5Vlq/jM3ZawwiacWjPa+smINyLRN07EO0cNBV6DGU= +github.com/decred/dcrd/chaincfg/chainhash v1.0.2/go.mod h1:BpbrGgrPTr3YJYRN3Bm+D9NuaFd+zGyNeIKgrhCXK60= +github.com/decred/dcrd/chaincfg/v2 v2.0.2 h1:VeGY52lHuYT01tIGbvYj+OO0GaGxGaJmnh+4vGca1+U= +github.com/decred/dcrd/chaincfg/v2 v2.0.2/go.mod h1:hpKvhLCDAD/xDZ3V1Pqpv9fIKVYYi11DyxETguazyvg= +github.com/decred/dcrd/chaincfg/v2 v2.1.0/go.mod h1:hpKvhLCDAD/xDZ3V1Pqpv9fIKVYYi11DyxETguazyvg= +github.com/decred/dcrd/chaincfg/v2 v2.3.0 h1:ItmU+7DeUtyiabrcW+16MJFgY/BBeeYaPfkBLrFLyjo= +github.com/decred/dcrd/chaincfg/v2 v2.3.0/go.mod h1:7qUJTvn+y/kswSRZ4sT2+EmvlDTDyy2InvNFtX/hxk0= +github.com/decred/dcrd/chaincfg/v3 v3.0.0-20200214194519-928737b3e580/go.mod h1:v4oyBPQ/ZstYCV7+B0y6HogFByW76xTjr+72fOm66Y8= +github.com/decred/dcrd/chaincfg/v3 v3.0.0-20200215015031-3283587e6add/go.mod h1:v4oyBPQ/ZstYCV7+B0y6HogFByW76xTjr+72fOm66Y8= +github.com/decred/dcrd/chaincfg/v3 v3.0.0-20200215023918-6247af01d5e3/go.mod h1:v4oyBPQ/ZstYCV7+B0y6HogFByW76xTjr+72fOm66Y8= +github.com/decred/dcrd/chaincfg/v3 v3.0.0-20200215031403-6b2ce76f0986 h1:NB6x4lAI19wftZoHBxYePkjEDWhQXH0C+Q42Q/DAZWM= +github.com/decred/dcrd/chaincfg/v3 v3.0.0-20200215031403-6b2ce76f0986/go.mod h1:v4oyBPQ/ZstYCV7+B0y6HogFByW76xTjr+72fOm66Y8= +github.com/decred/dcrd/connmgr/v3 v3.0.0-20200215045506-b2cef202a7cd/go.mod h1:mvIMJsrOEngogmVrq+tdbPIZchHVgGnVBZeNwj1cW6E= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/crypto/ripemd160 v1.0.0 h1:MciTnR4NfBqDFRFjFkrn8WPLP4Vo7t6ww6ghfn6wcXQ= +github.com/decred/dcrd/crypto/ripemd160 v1.0.0/go.mod h1:F0H8cjIuWTRoixr/LM3REB8obcWkmYx0gbxpQWR8RPg= +github.com/decred/dcrd/database/v2 v2.0.0/go.mod h1:Sj2lvTRB0mfSu9uD7ObfwCY/eJ954GFU/X+AndJIyfE= +github.com/decred/dcrd/database/v2 v2.0.1/go.mod h1:ZOaWTv3IlNqCA+y7q3q5EozgmiDOmNwCSq3ntZn2CDo= +github.com/decred/dcrd/dcrec v1.0.0 h1:W+z6Es+Rai3MXYVoPAxYr5U1DGis0Co33scJ6uH2J6o= +github.com/decred/dcrd/dcrec v1.0.0/go.mod h1:HIaqbEJQ+PDzQcORxnqen5/V1FR3B4VpIfmePklt8Q8= +github.com/decred/dcrd/dcrec/edwards v1.0.0 h1:UDcPNzclKiJlWqV3x1Fl8xMCJrolo4PB4X9t8LwKDWU= +github.com/decred/dcrd/dcrec/edwards v1.0.0/go.mod h1:HblVh1OfMt7xSxUL1ufjToaEvpbjpWvvTAUx4yem8BI= +github.com/decred/dcrd/dcrec/edwards/v2 v2.0.0 h1:E5KszxGgpjpmW8vN811G6rBAZg0/S/DftdGqN4FW5x4= +github.com/decred/dcrd/dcrec/edwards/v2 v2.0.0/go.mod h1:d0H8xGMWbiIQP7gN3v2rByWUcuZPm9YsgmnfoxgbINc= +github.com/decred/dcrd/dcrec/secp256k1 v1.0.1/go.mod h1:lhu4eZFSfTJWUnR3CFRcpD+Vta0KUAqnhTsTksHXgy0= +github.com/decred/dcrd/dcrec/secp256k1 v1.0.2 h1:awk7sYJ4pGWmtkiGHFfctztJjHMKGLV8jctGQhAbKe0= +github.com/decred/dcrd/dcrec/secp256k1 v1.0.2/go.mod h1:CHTUIVfmDDd0KFVFpNX1pFVCBUegxW387nN0IGwNKR0= +github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 h1:3GIJYXQDAKpLEFriGFN8SbSffak10UXHGdIcFaMPykY= +github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0/go.mod h1:3s92l0paYkZoIHuj4X93Teg/HB7eGM9x/zokGw+u4mY= +github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200214194519-928737b3e580/go.mod h1:Ej0/gOv8NpFfaczyXGndw7eRMJFVhmY2faSeyxztSUw= +github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200215015031-3283587e6add/go.mod h1:Ej0/gOv8NpFfaczyXGndw7eRMJFVhmY2faSeyxztSUw= +github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200215023918-6247af01d5e3/go.mod h1:Ej0/gOv8NpFfaczyXGndw7eRMJFVhmY2faSeyxztSUw= +github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200215031403-6b2ce76f0986 h1:r8PwukjSzsZeVOgq1M3Q6ml6A7zZGvMTFjmxFcl2XX8= +github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200215031403-6b2ce76f0986/go.mod h1:Ej0/gOv8NpFfaczyXGndw7eRMJFVhmY2faSeyxztSUw= +github.com/decred/dcrd/dcrjson/v3 v3.0.1/go.mod h1:fnTHev/ABGp8IxFudDhjGi9ghLiXRff1qZz/wvq12Mg= +github.com/decred/dcrd/dcrutil v1.3.0/go.mod h1:7fUT70QAarhDwQK62g92uDbbYpjXlXngpy5RBiecufo= +github.com/decred/dcrd/dcrutil v1.4.0 h1:xD5aUqysGQnsnP1c9J0kGeW8lDIwFGC3ja/gE3HnpCs= +github.com/decred/dcrd/dcrutil v1.4.0/go.mod h1:Bs74gm1jQ9ZAbmEh9FWOEZ1HQzlMg5iPATDMzMnCMlQ= +github.com/decred/dcrd/dcrutil/v2 v2.0.0 h1:HTqn2tZ8eqBF4y3hJwjyKBmJt16y7/HjzpE82E/crhY= +github.com/decred/dcrd/dcrutil/v2 v2.0.0/go.mod h1:gUshVAXpd51DlcEhr51QfWL2HJGkMDM1U8chY+9VvQg= +github.com/decred/dcrd/dcrutil/v2 v2.0.1 h1:aL+c7o7Q66HV1gIif+XkNYo9DeorN3l01Vns8mh0mqs= +github.com/decred/dcrd/dcrutil/v2 v2.0.1/go.mod h1:JdEgF6eh0TTohPeiqDxqDSikTSvAczq0J7tFMyyeD+k= +github.com/decred/dcrd/dcrutil/v3 v3.0.0-20200104000002-54b67d3474fb/go.mod h1:4/YL+e1ncKg50erd0PLp7vjZq1PcMftm6IU4rxzP6RA= +github.com/decred/dcrd/dcrutil/v3 v3.0.0-20200215015031-3283587e6add/go.mod h1:CibwaHcCfz1sedFseBYKt+1hSbqnWC4Oe95DM8dAOlA= +github.com/decred/dcrd/dcrutil/v3 v3.0.0-20200215023918-6247af01d5e3/go.mod h1:48ZLpNNrRIYfqYxmvzMgOZrnTZUU3aTJveWtamCkOxo= +github.com/decred/dcrd/dcrutil/v3 v3.0.0-20200215031403-6b2ce76f0986 h1:oT+4AnwK68i+xJlMUAh7G2wiazWY7ZaMWbBdXvV29mA= +github.com/decred/dcrd/dcrutil/v3 v3.0.0-20200215031403-6b2ce76f0986/go.mod h1:jFxEd2LWDLvrWlrIiyx9ZGTQjvoFHZ0OVfBdyIX7jSw= +github.com/decred/dcrd/gcs v1.1.0/go.mod h1:yBjhj217Vw5lw3aKnCdHip7fYb9zwMos8bCy5s79M9w= +github.com/decred/dcrd/gcs/v2 v2.0.0/go.mod h1:3XjKcrtvB+r2ezhIsyNCLk6dRnXRJVyYmsd1P3SkU3o= +github.com/decred/dcrd/hdkeychain/v3 v3.0.0-20200214234150-4f3c5d33ad03/go.mod h1:jW4d40s3Ad5b0uLTjDAgsW/XA3wT5yILXmfybYPdvKc= +github.com/decred/dcrd/rpc/jsonrpc/types v1.0.1/go.mod h1:dJUp9PoyFYklzmlImpVkVLOr6j4zKuUv66YgemP2sd8= +github.com/decred/dcrd/txscript v1.1.0 h1:MwkLXdc4Yq83oeNNEQJdlBTkNlorKXn8Nd5W2JXyMZg= +github.com/decred/dcrd/txscript v1.1.0/go.mod h1:gbcq6gpGfKddPmZSKp+17ils2cLzUqHopXf8H5rCY7Y= +github.com/decred/dcrd/txscript/v2 v2.0.0/go.mod h1:WStcyYYJa+PHJB4XjrLDRzV96/Z4thtsu8mZoVrU6C0= +github.com/decred/dcrd/txscript/v2 v2.1.0/go.mod h1:XaJAVrZU4NWRx4UEzTiDAs86op1m8GRJLz24SDBKOi0= +github.com/decred/dcrd/txscript/v3 v3.0.0-20200215023918-6247af01d5e3/go.mod h1:ATMA8K0SOo+M9Wdbr6dMnAd8qICJi6pXjGLlKsJc99E= +github.com/decred/dcrd/txscript/v3 v3.0.0-20200215031403-6b2ce76f0986 h1:TJaHYmmlMfASPO+o6DtM8NAIDCSFGgT8i1KPTKZ2xVg= +github.com/decred/dcrd/txscript/v3 v3.0.0-20200215031403-6b2ce76f0986/go.mod h1:KsDS7McU1yFaCYR9LCIwk6YnE15YN3wJUDxhKdFqlsc= +github.com/decred/dcrd/wire v1.2.0 h1:HqJVB7vcklIguzFWgRXw/WYCQ9cD3bUC5TKj53i1Hng= +github.com/decred/dcrd/wire v1.2.0/go.mod h1:/JKOsLInOJu6InN+/zH5AyCq3YDIOW/EqcffvU8fJHM= +github.com/decred/dcrd/wire v1.3.0 h1:X76I2/a8esUmxXmFpJpAvXEi014IA4twgwcOBeIS8lE= +github.com/decred/dcrd/wire v1.3.0/go.mod h1:fnKGlUY2IBuqnpxx5dYRU5Oiq392OBqAuVjRVSkIoXM= +github.com/decred/go-socks v1.1.0/go.mod h1:sDhHqkZH0X4JjSa02oYOGhcGHYp12FsY1jQ/meV8md0= +github.com/decred/slog v1.0.0 h1:Dl+W8O6/JH6n2xIFN2p3DNjCmjYwvrXsjlSJTQQ4MhE= +github.com/decred/slog v1.0.0/go.mod h1:zR98rEZHSnbZ4WHZtO0iqmSZjDLKhkXfrPTZQKtAonQ= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jrick/bitset v1.0.0/go.mod h1:ZOYB5Uvkla7wIEY4FEssPVi3IQXa02arznRaYaAEPe4= +github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI= +github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= +github.com/jrick/wsrpc/v2 v2.3.2/go.mod h1:XPYs8BnRWl99lCvXRM5SLpZmTPqWpSOPkDIqYTwDPfU= +github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.1 h1:PZSj/UFNaVp3KxrzHOcS7oyuWA7LoOY/77yCTEFu21U= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d h1:i6RB+Qz1ug7TvJdY4zieRMpnLAtkHSHTOvApNXfLT4A= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY= +golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/log.go b/log.go index 17eb9bd..aa86396 100644 --- a/log.go +++ b/log.go @@ -10,11 +10,10 @@ import ( "os" "path/filepath" - "github.com/btcsuite/btclog" - "github.com/jrick/logrotate/rotator" - + "github.com/decred/slog" "github.com/decred/tumblebit/rpc/rpcserver" "github.com/decred/tumblebit/tumbler" + "github.com/jrick/logrotate/rotator" ) // logWriter implements an io.Writer that outputs to both standard output and @@ -23,8 +22,7 @@ type logWriter struct{} func (logWriter) Write(p []byte) (n int, err error) { os.Stdout.Write(p) - logRotator.Write(p) - return len(p), nil + return logRotator.Write(p) } // Loggers per subsystem. A single backend logger is created and all subsytem @@ -39,7 +37,7 @@ var ( // backendLog is the logging backend used to create all subsystem loggers. // The backend must not be used before the log rotator has been initialized, // or data races and/or nil pointer dereferences will occur. - backendLog = btclog.NewBackend(logWriter{}) + backendLog = slog.NewBackend(logWriter{}) // logRotator is one of the logging outputs. It should be closed on // application shutdown. @@ -57,7 +55,7 @@ func init() { } // subsystemLoggers maps each subsystem identifier to its associated logger. -var subsystemLoggers = map[string]btclog.Logger{ +var subsystemLoggers = map[string]slog.Logger{ "DCRT": log, "TMBL": tumblerLog, "GRPC": grpcLog, @@ -93,7 +91,7 @@ func setLogLevel(subsystemID string, logLevel string) { } // Defaults to info if the log level is invalid. - level, _ := btclog.LevelFromString(logLevel) + level, _ := slog.LevelFromString(logLevel) logger.SetLevel(level) } diff --git a/netparams/params.go b/netparams/params.go index ba6c86d..c49106a 100644 --- a/netparams/params.go +++ b/netparams/params.go @@ -16,17 +16,17 @@ type Params struct { } // MainNetParams contains parameters specific running tumblebit and -// dcrd on the main network (wire.MainNet). +// dcrd on the main network. var MainNetParams = Params{ Params: &chaincfg.MainNetParams, WalletClientPort: "9111", TumblerServerPort: "9191", } -// TestNet2Params contains parameters specific running tumblebit and -// dcrd on the test network (version 2) (wire.TestNet2). -var TestNet2Params = Params{ - Params: &chaincfg.TestNet2Params, +// TestNet3Params contains parameters specific running tumblebit and +// dcrd on the test network. +var TestNet3Params = Params{ + Params: &chaincfg.TestNet3Params, WalletClientPort: "19111", TumblerServerPort: "19191", } diff --git a/rpc/rpcserver/log.go b/rpc/rpcserver/log.go index d25317a..8652712 100644 --- a/rpc/rpcserver/log.go +++ b/rpc/rpcserver/log.go @@ -18,23 +18,22 @@ import ( "os" "strings" + "github.com/decred/slog" "google.golang.org/grpc/grpclog" - - "github.com/btcsuite/btclog" ) // UseLogger sets the logger to use for the gRPC server. -func UseLogger(l btclog.Logger) { +func UseLogger(l slog.Logger) { grpclog.SetLogger(logger{l}) } -// logger uses a btclog.Logger to implement the grpclog.Logger interface. +// logger uses a slog.Logger to implement the grpclog.Logger interface. type logger struct { - btclog.Logger + slog.Logger } // stripGrpcPrefix removes the package prefix for all logs made to the grpc -// logger, since these are already included as the btclog subsystem name. +// logger, since these are already included as the slog subsystem name. func stripGrpcPrefix(logstr string) string { return strings.TrimPrefix(logstr, "grpc: ") } diff --git a/shuffle/shuffle.go b/shuffle/shuffle.go index dfdf2b9..846eab8 100644 --- a/shuffle/shuffle.go +++ b/shuffle/shuffle.go @@ -31,7 +31,7 @@ func Shuffle(random io.Reader, n int, swap func(i, j int)) *ShuffleMap { // Fisher-Yates shuffle: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle for i := n - 1; i > 0; i-- { j := int(uniformRandom31(random, int32(i+1))) - swap(i, int(j)) + swap(i, j) idx[i], idx[j] = idx[j], idx[i] perm[idx[i]] = i } diff --git a/tumbler/log.go b/tumbler/log.go index a5b705b..a342d82 100644 --- a/tumbler/log.go +++ b/tumbler/log.go @@ -4,12 +4,12 @@ package tumbler -import "github.com/btcsuite/btclog" +import "github.com/decred/slog" // log is a logger that is initialized with no output filters. This // means the package will not perform any logging by default until the caller // requests it. -var log btclog.Logger +var log slog.Logger // The default amount of logging is none. func init() { @@ -19,12 +19,12 @@ func init() { // DisableLog disables all library log output. Logging output is disabled // by default until either UseLogger or SetLogWriter are called. func DisableLog() { - log = btclog.Disabled + log = slog.Disabled } // UseLogger uses a specified Logger to output package logging info. // This should be used in preference to SetLogWriter if the caller is also -// using btclog. -func UseLogger(logger btclog.Logger) { +// using slog. +func UseLogger(logger slog.Logger) { log = logger } diff --git a/tumbler/tumbler.go b/tumbler/tumbler.go index 02468d3..a478d1d 100644 --- a/tumbler/tumbler.go +++ b/tumbler/tumbler.go @@ -408,7 +408,6 @@ func (tb *Tumbler) sessionTicker(ctx context.Context) error { } } } - return g.Wait() } func (tb *Tumbler) deferredActions(ctx context.Context, actions []*deferredAction) error { diff --git a/tumbler/tumbler_test.go b/tumbler/tumbler_test.go index 5005ef8..e57ebdc 100644 --- a/tumbler/tumbler_test.go +++ b/tumbler/tumbler_test.go @@ -12,8 +12,8 @@ import ( "math/big" "testing" - "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" ) @@ -321,32 +321,29 @@ func testPuzzleSolving(t *testing.T, s *Session, pkey *puzzle.PuzzlePubKey, return puzzleSolutions[0] } -var ecpriv chainec.PrivateKey -var ecpub chainec.PublicKey +var ecpriv *secp256k1.PrivateKey +var ecpub *secp256k1.PublicKey func init() { - priv, _, _, err := chainec.Secp256k1.GenerateKey(rand.Reader) + priv, err := secp256k1.GeneratePrivateKey() if err != nil { - panic("failed to generate private key") + panic(err) } - ecpriv, ecpub = chainec.Secp256k1.PrivKeyFromBytes(priv) + ecpriv = priv + ecpub = ecpriv.PubKey() } func secpSign(hash []byte) ([]byte, error) { - r, s, err := chainec.Secp256k1.Sign(ecpriv, hash) - if err != nil { - return nil, err - } - sig := chainec.Secp256k1.NewSignature(r, s) + sig := ecpriv.Sign(hash) return sig.Serialize(), nil } func secpVerify(sigBytes []byte, hash []byte) (bool, error) { - sig, err := chainec.Secp256k1.ParseSignature(sigBytes) + sig, err := secp256k1.ParseSignature(sigBytes) if err != nil { return false, err } - if !chainec.Secp256k1.Verify(ecpub, hash, sig.GetR(), sig.GetS()) { + if !sig.Verify(hash, ecpub) { return false, errors.New("failed to verify the signature") } return true, nil @@ -361,5 +358,5 @@ func signChallengeHashes(hashes [][]byte) ([][]byte, []byte, error) { return nil, nil, err } } - return signatures, ecpub.Serialize(), nil + return signatures, ecpub.SerializeCompressed(), nil } diff --git a/wallet/wallet.go b/wallet/wallet.go index 5fc8942..1bd11b6 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -11,10 +11,10 @@ import ( "errors" "fmt" + pb "decred.org/dcrwallet/rpc/walletrpc" "github.com/decred/dcrd/chaincfg" "github.com/decred/dcrd/txscript" "github.com/decred/dcrd/wire" - pb "github.com/decred/dcrwallet/rpc/walletrpc" "github.com/decred/tumblebit/contract" "google.golang.org/grpc" @@ -436,8 +436,7 @@ func (w *Wallet) OfferRedeemer(ctx context.Context, con *contract.Contract) (boo return false, nil, fmt.Errorf("Spender %v", err) } - if err = con.ParseTransaction(contract.RedeemTransaction, - sr.SpenderTransaction); err != nil { + if err = con.ParseRedeemTransaction(sr.SpenderTransaction); err != nil { return false, nil, fmt.Errorf("failed to parse redeeming tx: %v", err) }