Skip to content

Commit

Permalink
modules: handle auto-revocation agenda changes and update requires
Browse files Browse the repository at this point in the history
Use the new major versions: dcrjson/v4 and dcrec/secp256k1/v4.

Update all other decred requires.

This introduces a breaking change to stake.DetermineTxType, which now
requires a third argument, a bool indicating if the auto-revocation
agenda is active.  We are able to say "false" always for this because
post-activation revocations ADDS constraints, letting both types of
revocations be detected.
  • Loading branch information
chappjc committed Sep 16, 2021
1 parent d8e46bb commit c2bdeb5
Show file tree
Hide file tree
Showing 27 changed files with 119 additions and 116 deletions.
2 changes: 1 addition & 1 deletion client/asset/btc/btc.go
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil"
"github.com/decred/dcrd/dcrjson/v3" // for dcrjson.RPCError returns from rpcclient
"github.com/decred/dcrd/dcrjson/v4" // for dcrjson.RPCError returns from rpcclient
"github.com/decred/dcrd/rpcclient/v7"
)

Expand Down
6 changes: 3 additions & 3 deletions client/asset/dcr/dcr.go
Expand Up @@ -30,9 +30,9 @@ import (
walletjson "decred.org/dcrwallet/v2/rpc/jsonrpc/types"
"github.com/decred/dcrd/chaincfg/chainhash"
"github.com/decred/dcrd/chaincfg/v3"
"github.com/decred/dcrd/dcrec/secp256k1/v3"
"github.com/decred/dcrd/dcrec/secp256k1/v3/ecdsa"
"github.com/decred/dcrd/dcrjson/v3"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
"github.com/decred/dcrd/dcrjson/v4"
"github.com/decred/dcrd/dcrutil/v4"
"github.com/decred/dcrd/gcs/v3"
"github.com/decred/dcrd/gcs/v3/blockcf2"
Expand Down
4 changes: 2 additions & 2 deletions client/asset/dcr/dcr_test.go
Expand Up @@ -25,8 +25,8 @@ import (
"github.com/decred/dcrd/chaincfg/chainhash"
"github.com/decred/dcrd/chaincfg/v3"
"github.com/decred/dcrd/dcrec"
"github.com/decred/dcrd/dcrec/secp256k1/v3"
"github.com/decred/dcrd/dcrec/secp256k1/v3/ecdsa"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
"github.com/decred/dcrd/dcrutil/v4"
"github.com/decred/dcrd/gcs/v3"
"github.com/decred/dcrd/gcs/v3/blockcf2"
Expand Down
2 changes: 1 addition & 1 deletion client/core/account.go
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"

"decred.org/dcrdex/client/db"
"github.com/decred/dcrd/dcrec/secp256k1/v3"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
)

// AccountDisable is used to disable an account by given host and application
Expand Down
2 changes: 1 addition & 1 deletion client/core/bookie.go
Expand Up @@ -16,7 +16,7 @@ import (
"decred.org/dcrdex/dex/encode"
"decred.org/dcrdex/dex/msgjson"
"decred.org/dcrdex/dex/order"
"github.com/decred/dcrd/dcrec/secp256k1/v3"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions client/core/core.go
Expand Up @@ -35,8 +35,8 @@ import (
"decred.org/dcrdex/dex/wait"
"decred.org/dcrdex/server/account"
serverdex "decred.org/dcrdex/server/dex"
"github.com/decred/dcrd/dcrec/secp256k1/v3"
"github.com/decred/dcrd/dcrec/secp256k1/v3/ecdsa"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
"github.com/decred/go-socks/socks"
"golang.org/x/text/language"
"golang.org/x/text/message"
Expand Down
4 changes: 2 additions & 2 deletions client/core/core_test.go
Expand Up @@ -41,8 +41,8 @@ import (
"decred.org/dcrdex/server/account"
serverdex "decred.org/dcrdex/server/dex"
"github.com/decred/dcrd/crypto/blake256"
"github.com/decred/dcrd/dcrec/secp256k1/v3"
"github.com/decred/dcrd/dcrec/secp256k1/v3/ecdsa"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
"golang.org/x/text/language"
"golang.org/x/text/message"
)
Expand Down
4 changes: 2 additions & 2 deletions client/core/types.go
Expand Up @@ -18,8 +18,8 @@ import (
"decred.org/dcrdex/dex/encrypt"
"decred.org/dcrdex/dex/order"
"decred.org/dcrdex/server/account"
"github.com/decred/dcrd/dcrec/secp256k1/v3"
"github.com/decred/dcrd/dcrec/secp256k1/v3/ecdsa"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
"github.com/decred/dcrd/hdkeychain/v3"
)

Expand Down
2 changes: 1 addition & 1 deletion client/db/test/dbtest.go
Expand Up @@ -12,7 +12,7 @@ import (
"decred.org/dcrdex/client/asset"
"decred.org/dcrdex/client/db"
ordertest "decred.org/dcrdex/dex/order/test"
"github.com/decred/dcrd/dcrec/secp256k1/v3"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
)

// Generate a public key on the secp256k1 curve.
Expand Down
2 changes: 1 addition & 1 deletion client/db/types.go
Expand Up @@ -16,7 +16,7 @@ import (
"decred.org/dcrdex/dex/config"
"decred.org/dcrdex/dex/encode"
"decred.org/dcrdex/dex/order"
"github.com/decred/dcrd/dcrec/secp256k1/v3"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
"golang.org/x/crypto/blake2s"
)

Expand Down
2 changes: 1 addition & 1 deletion dex/networks/dcr/script_test.go
Expand Up @@ -12,7 +12,7 @@ import (
"decred.org/dcrdex/dex"
"github.com/decred/dcrd/chaincfg/chainhash"
"github.com/decred/dcrd/chaincfg/v3"
"github.com/decred/dcrd/dcrec/secp256k1/v3"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/decred/dcrd/dcrutil/v4"
"github.com/decred/dcrd/txscript/v4"
"github.com/decred/dcrd/txscript/v4/stdaddr"
Expand Down
35 changes: 18 additions & 17 deletions go.mod
Expand Up @@ -3,28 +3,29 @@ module decred.org/dcrdex
go 1.16

require (
decred.org/dcrwallet/v2 v2.0.0-20210714172147-8815838443cd
decred.org/dcrwallet/v2 v2.0.0-20210913145543-714c2f555f04
github.com/btcsuite/btcd v0.20.1-beta.0.20200615134404-e4f59022a387
github.com/btcsuite/btcutil v1.0.2
github.com/davecgh/go-spew v1.1.1
github.com/decred/dcrd/blockchain/stake/v4 v4.0.0-20210715032435-c9521b468f95
github.com/decred/dcrd/certgen v1.1.2-0.20210715032435-c9521b468f95
github.com/decred/dcrd/chaincfg/chainhash v1.0.3-0.20210715032435-c9521b468f95
github.com/decred/dcrd/chaincfg/v3 v3.0.1-0.20210715032435-c9521b468f95
github.com/decred/dcrd/crypto/blake256 v1.0.1-0.20210715032435-c9521b468f95
github.com/decred/dcrd/dcrec v1.0.1-0.20210715032435-c9521b468f95
github.com/decred/dcrd/blockchain/stake/v4 v4.0.0-20210914193033-2efb9bda71fe
github.com/decred/dcrd/certgen v1.1.2-0.20210901152745-8830d9c9cdba
github.com/decred/dcrd/chaincfg/chainhash v1.0.3
github.com/decred/dcrd/chaincfg/v3 v3.0.1-0.20210901152745-8830d9c9cdba
github.com/decred/dcrd/crypto/blake256 v1.0.1-0.20210901152745-8830d9c9cdba
github.com/decred/dcrd/database/v3 v3.0.0-20210914193033-2efb9bda71fe // indirect
github.com/decred/dcrd/dcrec v1.0.1-0.20210901152745-8830d9c9cdba
github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2-0.20210715032435-c9521b468f95
github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0
github.com/decred/dcrd/dcrjson/v3 v3.1.1-0.20210715032435-c9521b468f95
github.com/decred/dcrd/dcrutil/v4 v4.0.0-20210715032435-c9521b468f95
github.com/decred/dcrd/gcs/v3 v3.0.0-20210715032435-c9521b468f95
github.com/decred/dcrd/hdkeychain/v3 v3.0.1-0.20210715032435-c9521b468f95
github.com/decred/dcrd/rpc/jsonrpc/types/v3 v3.0.0-20210715032435-c9521b468f95
github.com/decred/dcrd/rpcclient/v7 v7.0.0-20210819154602-48627ee18c3d
github.com/decred/dcrd/txscript/v4 v4.0.0-20210715032435-c9521b468f95
github.com/decred/dcrd/wire v1.4.1-0.20210715032435-c9521b468f95
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0
github.com/decred/dcrd/dcrjson/v4 v4.0.0
github.com/decred/dcrd/dcrutil/v4 v4.0.0-20210914193033-2efb9bda71fe
github.com/decred/dcrd/gcs/v3 v3.0.0-20210914193033-2efb9bda71fe
github.com/decred/dcrd/hdkeychain/v3 v3.0.1-0.20210901152745-8830d9c9cdba
github.com/decred/dcrd/rpc/jsonrpc/types/v3 v3.0.0-20210914193033-2efb9bda71fe
github.com/decred/dcrd/rpcclient/v7 v7.0.0-20210914193033-2efb9bda71fe
github.com/decred/dcrd/txscript/v4 v4.0.0-20210914193033-2efb9bda71fe
github.com/decred/dcrd/wire v1.4.1-0.20210901152745-8830d9c9cdba
github.com/decred/go-socks v1.1.0
github.com/decred/slog v1.1.0
github.com/decred/slog v1.2.0
github.com/ethereum/go-ethereum v1.10.6
github.com/gcash/bchd v0.17.2-0.20201218180520-5708823e0e99
github.com/gcash/bchutil v0.0.0-20210113190856-6ea28dff4000
Expand Down

0 comments on commit c2bdeb5

Please sign in to comment.