BlockID returns the Commit's BlockID if CommitSig indicates signing, otherwise - empty BlockID.
(commitBlockID BlockID)
| 650 | // BlockID returns the Commit's BlockID if CommitSig indicates signing, |
| 651 | // otherwise - empty BlockID. |
| 652 | func (cs CommitSig) BlockID(commitBlockID BlockID) BlockID { |
| 653 | var blockID BlockID |
| 654 | switch cs.BlockIDFlag { |
| 655 | case BlockIDFlagAbsent: |
| 656 | blockID = BlockID{} |
| 657 | case BlockIDFlagCommit: |
| 658 | blockID = commitBlockID |
| 659 | case BlockIDFlagNil: |
| 660 | blockID = BlockID{} |
| 661 | default: |
| 662 | panic(fmt.Sprintf("Unknown BlockIDFlag: %v", cs.BlockIDFlag)) |
| 663 | } |
| 664 | return blockID |
| 665 | } |
| 666 | |
| 667 | // ValidateBasic performs basic validation. |
| 668 | func (cs CommitSig) ValidateBasic() error { |