mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-24 02:01:43 +00:00
ProposalPOLRound...
This commit is contained in:
@ -17,31 +17,31 @@ var (
|
||||
)
|
||||
|
||||
type Proposal struct {
|
||||
Height uint `json:"height"`
|
||||
Round uint `json:"round"`
|
||||
BlockParts types.PartSetHeader `json:"block_parts"`
|
||||
POLRound int `json:"pol_round"` // -1 if null.
|
||||
Signature account.SignatureEd25519 `json:"signature"`
|
||||
Height uint `json:"height"`
|
||||
Round uint `json:"round"`
|
||||
BlockPartsHeader types.PartSetHeader `json:"block_parts_header"`
|
||||
POLRound int `json:"pol_round"` // -1 if null.
|
||||
Signature account.SignatureEd25519 `json:"signature"`
|
||||
}
|
||||
|
||||
func NewProposal(height uint, round uint, blockParts types.PartSetHeader, polRound int) *Proposal {
|
||||
func NewProposal(height uint, round uint, blockPartsHeader types.PartSetHeader, polRound int) *Proposal {
|
||||
return &Proposal{
|
||||
Height: height,
|
||||
Round: round,
|
||||
BlockParts: blockParts,
|
||||
POLRound: polRound,
|
||||
Height: height,
|
||||
Round: round,
|
||||
BlockPartsHeader: blockPartsHeader,
|
||||
POLRound: polRound,
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Proposal) String() string {
|
||||
return fmt.Sprintf("Proposal{%v/%v %v %v %v}", p.Height, p.Round,
|
||||
p.BlockParts, p.POLRound, p.Signature)
|
||||
p.BlockPartsHeader, p.POLRound, p.Signature)
|
||||
}
|
||||
|
||||
func (p *Proposal) WriteSignBytes(chainID string, w io.Writer, n *int64, err *error) {
|
||||
binary.WriteTo([]byte(Fmt(`{"chain_id":"%s"`, chainID)), w, n, err)
|
||||
binary.WriteTo([]byte(`,"proposal":{"block_parts":`), w, n, err)
|
||||
p.BlockParts.WriteSignBytes(w, n, err)
|
||||
binary.WriteTo([]byte(`,"proposal":{"block_parts_header":`), w, n, err)
|
||||
p.BlockPartsHeader.WriteSignBytes(w, n, err)
|
||||
binary.WriteTo([]byte(Fmt(`,"height":%v,"pol_round":%v`, p.Height, p.POLRound)), w, n, err)
|
||||
binary.WriteTo([]byte(Fmt(`,"round":%v}}`, p.Round)), w, n, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user