WithBody returns a new block with the given transaction and uncle contents.
(transactions []*Transaction)
| 486 | |
| 487 | // WithBody returns a new block with the given transaction and uncle contents. |
| 488 | func (b *Block) WithBody(transactions []*Transaction) *Block { |
| 489 | block := &Block{ |
| 490 | header: CopyHeader(b.header), |
| 491 | transactions: make([]*Transaction, len(transactions)), |
| 492 | } |
| 493 | copy(block.transactions, transactions) |
| 494 | return block |
| 495 | } |
| 496 | |
| 497 | // Hash returns the keccak256 hash of b's header. |
| 498 | // The hash is computed on the first call and cached thereafter. |
no test coverage detected