core: append transactions to the block in GetBlock()
We want to get a full block, so it has to have transactions inside. Unfortunately our tests were used to this wrong behavior and utilized completely bogus transactions without data that couldn't be persisted, so fix that also.
This commit is contained in:
parent
d007cc00cc
commit
258f397b9a
5 changed files with 28 additions and 13 deletions
|
@ -172,14 +172,15 @@ func initBlocks(t *testing.T, chain *core.Blockchain) {
|
|||
func makeBlocks(n int) []*core.Block {
|
||||
blocks := make([]*core.Block, n)
|
||||
for i := 0; i < n; i++ {
|
||||
blocks[i] = newBlock(uint32(i+1), newTX(transaction.MinerType))
|
||||
blocks[i] = newBlock(uint32(i+1), newMinerTX())
|
||||
}
|
||||
return blocks
|
||||
}
|
||||
|
||||
func newTX(t transaction.TXType) *transaction.Transaction {
|
||||
func newMinerTX() *transaction.Transaction {
|
||||
return &transaction.Transaction{
|
||||
Type: t,
|
||||
Type: transaction.MinerType,
|
||||
Data: &transaction.MinerTX{},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue