Skip to content

Commit

Permalink
client/asset/btc: update btcd for block deserialization failure
Browse files Browse the repository at this point in the history
  • Loading branch information
chappjc committed Nov 1, 2022
1 parent ccd5edf commit 874e519
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
Binary file not shown.
13 changes: 13 additions & 0 deletions client/asset/btc/witness_fix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ var block757922 []byte
//go:embed test-data/bitcoin-tx-7393096d97bfee8660f4100ffd61874d62f9a65de9fb6acf740c4c386990ef73.dat
var tx7393096d9 []byte

//go:embed test-data/bitcoin-tx-73be398c4bdc43709db7398106609eea2a7841aaf3a4fa2000dc18184faa2a7e.dat
var tx73be398c4 []byte

func TestBigWitness(t *testing.T) {
msgBlock := &wire.MsgBlock{}
err := msgBlock.Deserialize(bytes.NewReader(block757922))
Expand All @@ -36,4 +39,14 @@ func TestBigWitness(t *testing.T) {
if h := msgTx.TxHash().String(); h != wantHash {
t.Errorf("got %v, wanted %v", h, wantHash)
}

msgTx = &wire.MsgTx{}
err = msgTx.Deserialize(bytes.NewReader(tx73be398c4))
if err != nil {
t.Fatal(err)
}
wantHash = "73be398c4bdc43709db7398106609eea2a7841aaf3a4fa2000dc18184faa2a7e"
if h := msgTx.TxHash().String(); h != wantHash {
t.Errorf("got %v, wanted %v", h, wantHash)
}
}
2 changes: 1 addition & 1 deletion dex/testing/loadbot/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
github.com/aead/siphash v1.0.1 // indirect
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 // indirect
github.com/btcsuite/btcd v0.23.2 // indirect
github.com/btcsuite/btcd v0.23.3 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.1 // indirect
github.com/btcsuite/btcd/btcutil v1.1.2 // indirect
github.com/btcsuite/btcd/btcutil/psbt v1.1.5 // indirect
Expand Down
4 changes: 2 additions & 2 deletions dex/testing/loadbot/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ github.com/btcsuite/btcd v0.22.0-beta.0.20220207191057-4dc4ff7963b4/go.mod h1:7a
github.com/btcsuite/btcd v0.22.0-beta.0.20220316175102-8d5c75c28923/go.mod h1:taIcYprAW2g6Z9S0gGUxyR+zDwimyDMK5ePOX+iJ2ds=
github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
github.com/btcsuite/btcd v0.23.1/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
github.com/btcsuite/btcd v0.23.2 h1:/YOgUp25sdCnP5ho6Hl3s0E438zlX+Kak7E6TgBgoT0=
github.com/btcsuite/btcd v0.23.2/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
github.com/btcsuite/btcd v0.23.3 h1:4KH/JKy9WiCd+iUS9Mu0Zp7Dnj17TGdKrg9xc/FGj24=
github.com/btcsuite/btcd v0.23.3/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA=
github.com/btcsuite/btcd/btcec/v2 v2.1.1/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
decred.org/dcrwallet/v2 v2.0.8
fyne.io/systray v1.10.1-0.20220621085403-9a2652634e93
github.com/btcsuite/btcd v0.23.2
github.com/btcsuite/btcd v0.23.3
github.com/btcsuite/btcd/btcec/v2 v2.2.1
github.com/btcsuite/btcd/btcutil v1.1.2
github.com/btcsuite/btcd/btcutil/psbt v1.1.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ github.com/btcsuite/btcd v0.22.0-beta.0.20220207191057-4dc4ff7963b4/go.mod h1:7a
github.com/btcsuite/btcd v0.22.0-beta.0.20220316175102-8d5c75c28923/go.mod h1:taIcYprAW2g6Z9S0gGUxyR+zDwimyDMK5ePOX+iJ2ds=
github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
github.com/btcsuite/btcd v0.23.1/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
github.com/btcsuite/btcd v0.23.2 h1:/YOgUp25sdCnP5ho6Hl3s0E438zlX+Kak7E6TgBgoT0=
github.com/btcsuite/btcd v0.23.2/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
github.com/btcsuite/btcd v0.23.3 h1:4KH/JKy9WiCd+iUS9Mu0Zp7Dnj17TGdKrg9xc/FGj24=
github.com/btcsuite/btcd v0.23.3/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA=
github.com/btcsuite/btcd/btcec/v2 v2.1.1/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
Expand Down

0 comments on commit 874e519

Please sign in to comment.