func TestArbDataOnly(t *testing.T) {
	if testing.Short() {
		t.SkipNow()
	}
	tpt, err := createTpoolTester(t.Name())
	if err != nil {
		t.Fatal(err)
	}
	defer tpt.Close()
	txn := types.Transaction{
		ArbitraryData: [][]byte{
			append(modules.PrefixNonSia[:], []byte("arb-data")...),
		},
	}
	err = tpt.tpool.AcceptTransactionSet([]types.Transaction{txn})
	if err != nil {
		t.Fatal(err)
	}
	if len(tpt.tpool.TransactionList()) != 1 {
		t.Error("expecting to see a transaction in the transaction pool")
	}
	_, err = tpt.miner.AddBlock()
	if err != nil {
		t.Fatal(err)
	}
	if len(tpt.tpool.TransactionList()) != 0 {
		t.Error("transaction was not cleared from the transaction pool")
	}
}
TestArbDataOnly tries submitting a transaction with only arbitrary data to
the transaction pool. Then a block is mined, putting the transaction on the
blockchain. The arb data transaction should no longer be in the transaction
pool.
package transactionpool
import (
	"sort"
	"testing"
	"time"
	"github.com/NebulousLabs/Sia/modules"
	"github.com/NebulousLabs/Sia/types"
)
func TestFindSets(t *testing.T) {
	graph1Size := 5
	edges := make([]types.TransactionGraphEdge, 0, graph1Size)
	for i := 0; i < graph1Size; i++ {
		edges = append(edges, types.TransactionGraphEdge{
			Dest:   i + 1,
			Fee:    types.NewCurrency64(5),
			Source: i,
			Value:  types.NewCurrency64(100),
		})
	}
	graph1, err := types.TransactionGraph(types.SiacoinOutputID{}, edges)
	if err != nil {
		t.Fatal(err)
	}
	sets := findSets(graph1)
	if len(sets) != 1 {
		t.Fatal("there should be only one set")
	}
	if len(sets[0]) != graph1Size {
		t.Error("findSets is not grouping the transactions correctly")
	}
	graph2Size := 6
	edges = make([]types.TransactionGraphEdge, 0, graph2Size)
	for i := 0; i < graph2Size; i++ {
		edges = append(edges, types.TransactionGraphEdge{
			Dest:   i + 1,
			Fee:    types.NewCurrency64(5),
			Source: i,
			Value:  types.NewCurrency64(100),
		})
	}
	graph2, err := types.TransactionGraph(types.SiacoinOutputID{1}, edges)
	if err != nil {
		t.Fatal(err)
	}
	sets = findSets(append(graph1, graph2...))
	if len(sets) != 2 {
		t.Fatal("there should be two sets")
	}
	lens := []int{len(sets[0]), len(sets[1])}
	sort.Ints(lens)
	expected := []int{graph1Size, graph2Size}
	sort.Ints(expected)
	if lens[0] != expected[0] || lens[1] != expected[1] {
		t.Error("Resulting sets do not have the right lengths")
	}
	edges = make([]types.TransactionGraphEdge, 0, 5)
	sources := []int{0, 0, 1, 2, 3}
	dests := []int{1, 2, 3, 3, 4}
	for i := 0; i < 5; i++ {
		edges = append(edges, types.TransactionGraphEdge{
			Dest:   dests[i],
			Fee:    types.NewCurrency64(5),
			Source: sources[i],
			Value:  types.NewCurrency64(100),
		})
	}
	graph3, err := types.TransactionGraph(types.SiacoinOutputID{2}, edges)
	graph3Size := len(graph3)
	if err != nil {
		t.Fatal(err)
	}
	sets = findSets(append(graph1, append(graph2, graph3...)...))
	if len(sets) != 3 {
		t.Fatal("there should be two sets")
	}
	lens = []int{len(sets[0]), len(sets[1]), len(sets[2])}
	sort.Ints(lens)
	expected = []int{graph1Size, graph2Size, graph3Size}
	sort.Ints(expected)
	if lens[0] != expected[0] || lens[1] != expected[1] || lens[2] != expected[2] {
		t.Error("Resulting sets do not have the right lengths")
	}
	var sporadic []types.Transaction
	for len(graph1) > 0 || len(graph2) > 0 || len(graph3) > 0 {
		if len(graph1) > 0 {
			sporadic = append(sporadic, graph1[0])
			graph1 = graph1[1:]
		}
		if len(graph2) > 0 {
			sporadic = append(sporadic, graph2[0])
			graph2 = graph2[1:]
		}
		if len(graph3) > 0 {
			sporadic = append(sporadic, graph3[0])
			graph3 = graph3[1:]
		}
	}
	if len(sporadic) != graph1Size+graph2Size+graph3Size {
		t.Error("sporadic block creation failed")
	}
	sets = findSets(sporadic)
	if len(sets) != 3 {
		t.Fatal("there should be two sets")
	}
	lens = []int{len(sets[0]), len(sets[1]), len(sets[2])}
	sort.Ints(lens)
	expected = []int{graph1Size, graph2Size, graph3Size}
	sort.Ints(expected)
	if lens[0] != expected[0] || lens[1] != expected[1] || lens[2] != expected[2] {
		t.Error("Resulting sets do not have the right lengths")
	}
}