Skip to content

Commit

Permalink
Merge pull request #104 from kcalvinalvin/2024-01-07-dcr-ec
Browse files Browse the repository at this point in the history
multi: Switch btcec over to btcd/btcec
  • Loading branch information
kcalvinalvin authored Jan 7, 2024
2 parents 0bc2fe9 + e596d32 commit 338cf51
Show file tree
Hide file tree
Showing 45 changed files with 144 additions and 7,671 deletions.
4 changes: 2 additions & 2 deletions addrmgr/addrmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"testing"
"time"

"github.com/btcsuite/btcd/addrmgr"
"github.com/btcsuite/btcd/wire"
"github.com/utreexo/utreexod/addrmgr"
"github.com/utreexo/utreexod/wire"
)

// naTest is used to describe a test to be performed against the NetAddressKey
Expand Down
4 changes: 2 additions & 2 deletions addrmgr/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"net"
"testing"

"github.com/btcsuite/btcd/addrmgr"
"github.com/btcsuite/btcd/wire"
"github.com/utreexo/utreexod/addrmgr"
"github.com/utreexo/utreexod/wire"
)

// TestIPTypes ensures the various functions which determine the type of an IP
Expand Down
8 changes: 4 additions & 4 deletions blockchain/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package blockchain

import (
"github.com/utreexo/utreexod/btcec"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/utreexo/utreexod/txscript"
)

Expand Down Expand Up @@ -218,7 +218,7 @@ func isPubKey(script []byte) (bool, []byte) {

// Ensure the public key is valid.
serializedPubKey := script[1:34]
_, err := btcec.ParsePubKey(serializedPubKey, btcec.S256())
_, err := btcec.ParsePubKey(serializedPubKey)
if err == nil {
return true, serializedPubKey
}
Expand All @@ -230,7 +230,7 @@ func isPubKey(script []byte) (bool, []byte) {

// Ensure the public key is valid.
serializedPubKey := script[1:66]
_, err := btcec.ParsePubKey(serializedPubKey, btcec.S256())
_, err := btcec.ParsePubKey(serializedPubKey)
if err == nil {
return true, serializedPubKey
}
Expand Down Expand Up @@ -399,7 +399,7 @@ func decompressScript(compressedPkScript []byte) []byte {
compressedKey := make([]byte, 33)
compressedKey[0] = byte(encodedScriptSize - 2)
copy(compressedKey[1:], compressedPkScript[1:])
key, err := btcec.ParsePubKey(compressedKey, btcec.S256())
key, err := btcec.ParsePubKey(compressedKey)
if err != nil {
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions blockchain/fullblocktests/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"runtime"
"time"

"github.com/btcsuite/btcd/btcec/v2"
"github.com/utreexo/utreexod/blockchain"
"github.com/utreexo/utreexod/btcec"
"github.com/utreexo/utreexod/btcutil"
"github.com/utreexo/utreexod/chaincfg"
"github.com/utreexo/utreexod/chaincfg/chainhash"
Expand Down Expand Up @@ -234,7 +234,7 @@ type testGenerator struct {
// makeTestGenerator returns a test generator instance initialized with the
// genesis block as the tip.
func makeTestGenerator(params *chaincfg.Params) (testGenerator, error) {
privKey, _ := btcec.PrivKeyFromBytes(btcec.S256(), []byte{0x01})
privKey, _ := btcec.PrivKeyFromBytes([]byte{0x01})
genesis := params.GenesisBlock
genesisHash := genesis.BlockHash()
return testGenerator{
Expand Down
68 changes: 0 additions & 68 deletions btcec/README.md

This file was deleted.

145 changes: 0 additions & 145 deletions btcec/bench_test.go

This file was deleted.

Loading

0 comments on commit 338cf51

Please sign in to comment.