aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2018-10-09 13:23:19 +0800
committerGitHub <noreply@github.com>2018-10-09 13:23:19 +0800
commit599d410e062f3b04763c628d1eb4815ff6d4d109 (patch)
treeb006a278a3bea241f0953280f14c66a2121ac161
parent86e15da7cee5463e37b972683b6b2fcf151a4a77 (diff)
parent0fe96810946fa1d331dd4c5cb09a596aec3ce550 (diff)
downloaddexon-consensus-599d410e062f3b04763c628d1eb4815ff6d4d109.tar
dexon-consensus-599d410e062f3b04763c628d1eb4815ff6d4d109.tar.gz
dexon-consensus-599d410e062f3b04763c628d1eb4815ff6d4d109.tar.bz2
dexon-consensus-599d410e062f3b04763c628d1eb4815ff6d4d109.tar.lz
dexon-consensus-599d410e062f3b04763c628d1eb4815ff6d4d109.tar.xz
dexon-consensus-599d410e062f3b04763c628d1eb4815ff6d4d109.tar.zst
dexon-consensus-599d410e062f3b04763c628d1eb4815ff6d4d109.zip
Merge pull request #187 from dexon-foundation/w-bytes
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