Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
rohenaz committed Jan 25, 2023
1 parent f9abf82 commit c0e3d77
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions bob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ func TestNewFromRawTxString(t *testing.T) {
}
}

// X5R

func TestMapFromRawTxString2(t *testing.T) {
bob, err := NewFromRawTxString(`01000000018952fe8892c429e69feb9b2dd9cd1f12ed757dc62e8d628b5a215f78ed895374020000006a47304402204784632fabca0f4aaa05dd6983633b2e8bf708d8766d0385f3393fff0623b88c02201a760e144116d47967501c2ea50dc231ae57c0eb78769d63713ce0648025c820412103221cb24c4e8b05a58bcf2ee8411f62e337c8099c8646babd47d0960899f69acaffffffff04680b0000000000001976a91409cc4559bdcb84cb35c107743f0dbb10d66679cc88ac0f720000000000001976a9146b1fe7b2063aa07766c764c0796fd4efd00340f288ac8a893b00000000001976a914be5f62df829ef754b8be09b37b04c4e7f9ff59d588ac0000000000000000ad006a223150755161374b36324d694b43747373534c4b79316b683536575755374d74555235035345540361707008746f6e6963706f7704747970650b6f666665725f636c69636b0f6f666665725f636f6e6669675f696403383038106f666665725f73657373696f6e5f6964403464303537386561643432393266653163643163393936643931623534613130653333653334623031396231386330613564353730376461346461346437653900000000`)

Expand Down Expand Up @@ -604,22 +606,20 @@ func TestTx_ToString(t *testing.T) {
}

// ExampleTx_ToString example using ToString()
func ExampleTx_ToString() {
func ExampleTx_ToString(t *testing.T) {
// Use an example TX
bobTx, err := NewFromString(sampleBobTx)
if err != nil {
fmt.Printf("error occurred: %s", err.Error())
return
}
assert.NoError(t, err)

var rawTx string
if rawTx, err = bobTx.ToString(); err != nil {
fmt.Printf("error occurred: %s", err.Error())
return
}

fmt.Printf("found raw tx: %d (length)", len(rawTx)) // todo: show raw tx if possible
// Output:found raw tx: 1782 (length)
assert.NoError(t, err)
assert.Equal(t, len(sampleBobTx), len(rawTx))
}

// BenchmarkTx_ToString benchmarks the method ToString()
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
require github.com/kr/pretty v0.3.1 // indirect

require (
github.com/bitcoinschema/go-bpu v0.0.2
github.com/bitcoinschema/go-bpu v0.0.3
github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/libsv/go-bk v0.1.6 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/bitcoinschema/go-bitcoin/v2 v2.0.0-alpha.3 h1:sIg1FAKz7RSWDM5bu4L5OPIPKu11mPtiFFunVyjiGjk=
github.com/bitcoinschema/go-bitcoin/v2 v2.0.0-alpha.3/go.mod h1:VN6ACz7ptkAvJ6PcPEb2pt5lAlKlJtGE1smtjKn3i8I=
github.com/bitcoinschema/go-bpu v0.0.2 h1:+Fglh48gFNzWO6FTHpV9V7iViy09GdAJPl1Toxcm2KQ=
github.com/bitcoinschema/go-bpu v0.0.2/go.mod h1:i41D9NP5KIk/oCt8XrRhN27YerZCUG6vjScXDhNn5Us=
github.com/bitcoinschema/go-bpu v0.0.3 h1:Lz5BU36DYmod0lVPrMFO2NIG650PXRcC6e3SQhvpeeQ=
github.com/bitcoinschema/go-bpu v0.0.3/go.mod h1:i41D9NP5KIk/oCt8XrRhN27YerZCUG6vjScXDhNn5Us=
github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173 h1:2yTIV9u7H0BhRDGXH5xrAwAz7XibWJtX2dNezMeNsUo=
github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173/go.mod h1:BZ1UcC9+tmcDEcdVXgpt13hMczwJxWzpAn68wNs7zRA=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
Expand Down

0 comments on commit c0e3d77

Please sign in to comment.