aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-09-04 17:39:05 +0800
committerGitHub <noreply@github.com>2018-09-04 17:39:05 +0800
commit04a63a22a24abaaa91b1d981e6d95260d80dadf4 (patch)
treed8e7335984a1b53f097f00f4e4956112d22aa673 /crypto
parent09393166791785ab6730b1c812b4a4fd07a92293 (diff)
downloaddexon-consensus-04a63a22a24abaaa91b1d981e6d95260d80dadf4.tar
dexon-consensus-04a63a22a24abaaa91b1d981e6d95260d80dadf4.tar.gz
dexon-consensus-04a63a22a24abaaa91b1d981e6d95260d80dadf4.tar.bz2
dexon-consensus-04a63a22a24abaaa91b1d981e6d95260d80dadf4.tar.lz
dexon-consensus-04a63a22a24abaaa91b1d981e6d95260d80dadf4.tar.xz
dexon-consensus-04a63a22a24abaaa91b1d981e6d95260d80dadf4.tar.zst
dexon-consensus-04a63a22a24abaaa91b1d981e6d95260d80dadf4.zip
core: BA-based consensus core. (#93)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/utils.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/utils.go b/crypto/utils.go
index dfb4987..07a8b2b 100644
--- a/crypto/utils.go
+++ b/crypto/utils.go
@@ -18,6 +18,8 @@
package crypto
import (
+ "encoding/hex"
+
"github.com/ethereum/go-ethereum/crypto"
"github.com/dexon-foundation/dexon-consensus-core/common"
@@ -33,3 +35,7 @@ func Keccak256Hash(data ...[]byte) (h common.Hash) {
func (sig Signature) Clone() Signature {
return append(Signature{}, sig...)
}
+
+func (sig Signature) String() string {
+ return hex.EncodeToString([]byte(sig[:]))
+}