Skip to content

Commit

Permalink
consensus: add addl helper NewBlockIdFromString()
Browse files Browse the repository at this point in the history
Signed-off-by: William Katsak <bill@taekion.com>
  • Loading branch information
wkatsak committed Oct 5, 2022
1 parent fa07ee0 commit f490bfa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions consensus/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ func NewBlockIdFromBytes(blockIdBytes []byte) BlockId {
return BlockId(blockIdBytes)
}

func NewBlockIdFromString(blockIdString string) BlockId {
blockIdBytes, _ := hex.DecodeString(blockIdString)
return NewBlockIdFromBytes(blockIdBytes)
}

// A PeerId is an identifier for a peer.
type PeerId string

Expand Down

0 comments on commit f490bfa

Please sign in to comment.