(tb testing.TB, prev *bc.UnsignedBlock)
| 303 | } |
| 304 | |
| 305 | func generate(tb testing.TB, prev *bc.UnsignedBlock) *bc.UnsignedBlock { |
| 306 | prevID := prev.Hash() |
| 307 | b := &bc.UnsignedBlock{ |
| 308 | BlockHeader: &bc.BlockHeader{ |
| 309 | Version: 3, |
| 310 | Height: prev.Height + 1, |
| 311 | PreviousBlockId: &prevID, |
| 312 | TimestampMs: prev.TimestampMs + 1, |
| 313 | NextPredicate: prev.NextPredicate, |
| 314 | }, |
| 315 | } |
| 316 | |
| 317 | txRoot := bc.TxMerkleRoot(nil) |
| 318 | b.TransactionsRoot = &txRoot |
| 319 | |
| 320 | return b |
| 321 | } |
| 322 | |
| 323 | func mustDecodeHex(str string) []byte { |
| 324 | decoded, err := hex.DecodeString(str) |
no test coverage detected