Esempio n. 1
0
func assertValidUnspent(t *testing.T, bc *coin.Blockchain,
	unspent *coin.UnspentPool, tx coin.Transaction) {
	expect := bc.TxUxOut(tx, coin.BlockHeader{})
	assert.NotEqual(t, len(expect), 0)
	assert.Equal(t, len(expect), len(unspent.Arr))
	for _, ux := range expect {
		assert.True(t, unspent.Has(ux.Hash()))
	}
}
Esempio n. 2
0
func assertValidUnspent(t *testing.T, bc *coin.Blockchain,
	unspent *coin.UnspentPool, tx coin.Transaction) {
	expect := coin.CreateExpectedUnspents(tx)
	assert.NotEqual(t, len(expect), 0)
	assert.Equal(t, len(expect), len(unspent.Pool))
	for _, ux := range expect {
		assert.True(t, unspent.Has(ux.Hash()))
	}
}