Skip to content

Commit

Permalink
remove panic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rohenaz committed Oct 27, 2020
1 parent c6d1a19 commit 7a2c059
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,29 +329,6 @@ func TestCreateTxErrors(t *testing.T) {
}
}

// TestCreateTxPanic tests for nil case in CreateTx()
func TestCreateTxPanic(t *testing.T) {
t.Parallel()

defer func() {
if r := recover(); r == nil {
t.Errorf("the code did not panic")
}
}()

privateKey, _ := WifToPrivateKey("")

_, _ = CreateTx([]*Utxo{{
TxID: "b7b0650a7c3a1bd4716369783876348b59f5404784970192cec1996e86950576",
Vout: 0,
ScriptSig: "76a9149cbe9f5e72fa286ac8a38052d1d5337aa363ea7f88ac",
Satoshis: 1000,
}}, []*PayToAddress{{
Address: "1C8bzHM8XFBHZ2ZZVvFy2NSoAZbwCXAicL",
Satoshis: 500,
}}, []OpReturnData{{[]byte("prefix1"), []byte("example data"), []byte{0x13, 0x37}}}, privateKey)
}

// TestCreateTxUsingWif will test the method CreateTxUsingWif()
func TestCreateTxUsingWif(t *testing.T) {

Expand Down Expand Up @@ -935,29 +912,6 @@ func TestCreateTxWithChangeErrors(t *testing.T) {
}
}

// TestCreateTxWithChangePanic tests for nil case in CreateTxWithChange()
func TestCreateTxWithChangePanic(t *testing.T) {
t.Parallel()

defer func() {
if r := recover(); r == nil {
t.Errorf("the code did not panic")
}
}()

privateKey, _ := WifToPrivateKey("")

_, _ = CreateTxWithChange([]*Utxo{{
TxID: "b7b0650a7c3a1bd4716369783876348b59f5404784970192cec1996e86950576",
Vout: 0,
ScriptSig: "76a9149cbe9f5e72fa286ac8a38052d1d5337aa363ea7f88ac",
Satoshis: 1000,
}}, []*PayToAddress{{
Address: "1C8bzHM8XFBHZ2ZZVvFy2NSoAZbwCXAicL",
Satoshis: 500,
}}, []OpReturnData{{[]byte("prefix1"), []byte("example data"), []byte{0x13, 0x37}}}, "1C8bzHM8XFBHZ2ZZVvFy2NSoAZbwCXAicL", nil, nil, privateKey)
}

// ExampleCreateTxWithChange example using CreateTxWithChange()
func ExampleCreateTxWithChange() {

Expand Down

0 comments on commit 7a2c059

Please sign in to comment.