(tb testing.TB)
| 72 | } |
| 73 | |
| 74 | func newInitialBlock(tb testing.TB) *bc.Block { |
| 75 | script, err := vmutil.BlockMultiSigProgram(nil, 0) |
| 76 | if err != nil { |
| 77 | tb.Fatal(err) |
| 78 | } |
| 79 | |
| 80 | root, err := bc.MerkleRoot(nil) // calculate the zero value of the tx merkle root |
| 81 | if err != nil { |
| 82 | tb.Fatal(err) |
| 83 | } |
| 84 | |
| 85 | b := &legacy.Block{ |
| 86 | BlockHeader: legacy.BlockHeader{ |
| 87 | Version: 1, |
| 88 | Height: 1, |
| 89 | TimestampMS: bc.Millis(time.Now()), |
| 90 | BlockCommitment: legacy.BlockCommitment{ |
| 91 | TransactionsMerkleRoot: root, |
| 92 | ConsensusProgram: script, |
| 93 | }, |
| 94 | }, |
| 95 | } |
| 96 | return legacy.MapBlock(b) |
| 97 | } |
| 98 | |
| 99 | func generate(tb testing.TB, prev *bc.Block) *bc.Block { |
| 100 | b := &legacy.Block{ |
no outgoing calls
no test coverage detected