mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-29 03:22:51 +00:00
post rebase fixes for BlockID, partSize
This commit is contained in:
+2
-2
@@ -22,7 +22,7 @@ type Block struct {
|
||||
}
|
||||
|
||||
func MakeBlock(height int, chainID string, txs []Tx, commit *Commit,
|
||||
prevBlockID BlockID, valHash, appHash []byte) (*Block, *PartSet) {
|
||||
prevBlockID BlockID, valHash, appHash []byte, partSize int) (*Block, *PartSet) {
|
||||
block := &Block{
|
||||
Header: &Header{
|
||||
ChainID: chainID,
|
||||
@@ -39,7 +39,7 @@ func MakeBlock(height int, chainID string, txs []Tx, commit *Commit,
|
||||
},
|
||||
}
|
||||
block.FillHeader()
|
||||
return block, block.MakePartSet()
|
||||
return block, block.MakePartSet(partSize)
|
||||
}
|
||||
|
||||
// Basic validation that doesn't involve state data.
|
||||
|
||||
+9
-3
@@ -12,17 +12,23 @@ type tm2pb struct{}
|
||||
func (tm2pb) Header(header *Header) *types.Header {
|
||||
return &types.Header{
|
||||
ChainId: header.ChainID,
|
||||
Height: uint64(header.Height),
|
||||
Height: int32(header.Height),
|
||||
Time: uint64(header.Time.Unix()),
|
||||
NumTxs: uint64(header.NumTxs),
|
||||
LastBlockHash: header.LastBlockHash,
|
||||
LastBlockParts: TM2PB.PartSetHeader(header.LastBlockParts),
|
||||
LastBlockId: TM2PB.BlockID(header.LastBlockID),
|
||||
LastCommitHash: header.LastCommitHash,
|
||||
DataHash: header.DataHash,
|
||||
AppHash: header.AppHash,
|
||||
}
|
||||
}
|
||||
|
||||
func (tm2pb) BlockID(blockID BlockID) *types.BlockID {
|
||||
return &types.BlockID{
|
||||
Hash: blockID.Hash,
|
||||
Parts: TM2PB.PartSetHeader(blockID.PartsHeader),
|
||||
}
|
||||
}
|
||||
|
||||
func (tm2pb) PartSetHeader(partSetHeader PartSetHeader) *types.PartSetHeader {
|
||||
return &types.PartSetHeader{
|
||||
Total: uint64(partSetHeader.Total),
|
||||
|
||||
Reference in New Issue
Block a user