mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-20 15:02:33 +00:00
Add helper methods to ExtendedCommitSig and ExtendedCommit
Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
+13
-7
@@ -779,14 +779,14 @@ func (ecs ExtendedCommitSig) Absent() bool {
|
||||
// 4. timestamp
|
||||
// 5. first 6 bytes of vote extension
|
||||
// 6. first 6 bytes of vote extension signature
|
||||
func (cs ExtendedCommitSig) String() string {
|
||||
func (ecs ExtendedCommitSig) String() string {
|
||||
return fmt.Sprintf("ExtendedCommitSig{%X by %X on %v @ %s with %X %X}",
|
||||
tmbytes.Fingerprint(cs.Signature),
|
||||
tmbytes.Fingerprint(cs.ValidatorAddress),
|
||||
cs.BlockIDFlag,
|
||||
CanonicalTime(cs.Timestamp),
|
||||
tmbytes.Fingerprint(cs.VoteExtension),
|
||||
tmbytes.Fingerprint(cs.ExtensionSignature),
|
||||
tmbytes.Fingerprint(ecs.Signature),
|
||||
tmbytes.Fingerprint(ecs.ValidatorAddress),
|
||||
ecs.BlockIDFlag,
|
||||
CanonicalTime(ecs.Timestamp),
|
||||
tmbytes.Fingerprint(ecs.VoteExtension),
|
||||
tmbytes.Fingerprint(ecs.ExtensionSignature),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1170,6 +1170,12 @@ func NewExtendedCommit(height int64, round int32, blockID BlockID, extCommitSigs
|
||||
}
|
||||
}
|
||||
|
||||
// Copy creates a copy of this extended commit.
|
||||
func (extCommit *ExtendedCommit) Copy() *ExtendedCommit {
|
||||
ec := *extCommit
|
||||
return &ec
|
||||
}
|
||||
|
||||
// ToVoteSet constructs a VoteSet from the Commit and validator set.
|
||||
// Panics if signatures from the commit can't be added to the voteset.
|
||||
// Inverse of VoteSet.MakeCommit().
|
||||
|
||||
Reference in New Issue
Block a user