diff options
| author | Mission Liao <mission.liao@dexon.org> | 2019-01-21 14:18:38 +0800 |
|---|---|---|
| committer | Mission Liao <mission.liao@dexon.org> | 2019-01-28 16:19:51 +0800 |
| commit | 9e9c9f836b603d7ec1e0d169148f0d63a83ca2df (patch) | |
| tree | 42c5e2026c9e8cf1e63374e99421fd8f824adf11 | |
| parent | a9b56fceb4c58fdc44299d526a422fccb1f2ebc3 (diff) | |
| download | dexon-consensus-9e9c9f836b603d7ec1e0d169148f0d63a83ca2df.tar dexon-consensus-9e9c9f836b603d7ec1e0d169148f0d63a83ca2df.tar.gz dexon-consensus-9e9c9f836b603d7ec1e0d169148f0d63a83ca2df.tar.bz2 dexon-consensus-9e9c9f836b603d7ec1e0d169148f0d63a83ca2df.tar.lz dexon-consensus-9e9c9f836b603d7ec1e0d169148f0d63a83ca2df.tar.xz dexon-consensus-9e9c9f836b603d7ec1e0d169148f0d63a83ca2df.tar.zst dexon-consensus-9e9c9f836b603d7ec1e0d169148f0d63a83ca2df.zip | |
Add string representation for types.VoteType
| -rw-r--r-- | core/types/vote.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/types/vote.go b/core/types/vote.go index 46ea1df..27c7025 100644 --- a/core/types/vote.go +++ b/core/types/vote.go @@ -38,6 +38,22 @@ const ( MaxVoteType ) +func (t VoteType) String() string { + switch t { + case VoteInit: + return "Init" + case VotePreCom: + return "PreCom" + case VoteCom: + return "Com" + case VoteFast: + return "Fast" + case VoteFastCom: + return "FastCom" + } + panic(fmt.Errorf("attempting to dump unknown vote type: %d", t)) +} + // NullBlockHash is the blockHash for ⊥ value. var NullBlockHash common.Hash |
