aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-10-09 12:19:33 +0800
committerWei-Ning Huang <w@dexon.org>2018-10-09 12:20:07 +0800
commite29ec41836d09bf0dab4a76fa3c3edadc4f206a8 (patch)
tree335ec40facc10edf73a787391445700a4741d96e
parent9267d50de25ddf0f280eee797e2030ea989294e4 (diff)
downloaddexon-consensus-e29ec41836d09bf0dab4a76fa3c3edadc4f206a8.tar
dexon-consensus-e29ec41836d09bf0dab4a76fa3c3edadc4f206a8.tar.gz
dexon-consensus-e29ec41836d09bf0dab4a76fa3c3edadc4f206a8.tar.bz2
dexon-consensus-e29ec41836d09bf0dab4a76fa3c3edadc4f206a8.tar.lz
dexon-consensus-e29ec41836d09bf0dab4a76fa3c3edadc4f206a8.tar.xz
dexon-consensus-e29ec41836d09bf0dab4a76fa3c3edadc4f206a8.tar.zst
dexon-consensus-e29ec41836d09bf0dab4a76fa3c3edadc4f206a8.zip
common: add Bytes() method to Hash
-rw-r--r--common/types.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/types.go b/common/types.go
index 1bda164..f51a519 100644
--- a/common/types.go
+++ b/common/types.go
@@ -53,6 +53,11 @@ func (h Hash) String() string {
return hex.EncodeToString([]byte(h[:]))
}
+// Bytes return the hash as slice of bytes.
+func (h Hash) Bytes() []byte {
+ return h[:]
+}
+
// Equal compares if two hashes are the same.
func (h Hash) Equal(hp Hash) bool {
return h == hp