aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/whisper.go
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2015-03-16 22:17:19 +0800
committerMaran <maran.hidskes@gmail.com>2015-03-16 23:56:11 +0800
commit7330c97b5b00255db9dc1ffaff942992f80fb7d1 (patch)
treead189e91b7ea84221944349b06b8265dc66fc757 /xeth/whisper.go
parent22893b7ac925c49168c119f293ea8befc3aff5cc (diff)
downloaddexon-7330c97b5b00255db9dc1ffaff942992f80fb7d1.tar
dexon-7330c97b5b00255db9dc1ffaff942992f80fb7d1.tar.gz
dexon-7330c97b5b00255db9dc1ffaff942992f80fb7d1.tar.bz2
dexon-7330c97b5b00255db9dc1ffaff942992f80fb7d1.tar.lz
dexon-7330c97b5b00255db9dc1ffaff942992f80fb7d1.tar.xz
dexon-7330c97b5b00255db9dc1ffaff942992f80fb7d1.tar.zst
dexon-7330c97b5b00255db9dc1ffaff942992f80fb7d1.zip
DRY up the use of toHex in the project and move it to common
Diffstat (limited to 'xeth/whisper.go')
-rw-r--r--xeth/whisper.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/xeth/whisper.go b/xeth/whisper.go
index 76bf8012a..c43eb4388 100644
--- a/xeth/whisper.go
+++ b/xeth/whisper.go
@@ -4,8 +4,8 @@ import (
"errors"
"time"
- "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/whisper"
)
@@ -56,7 +56,7 @@ func (self *Whisper) Post(payload string, to, from string, topics []string, prio
func (self *Whisper) NewIdentity() string {
key := self.Whisper.NewIdentity()
- return toHex(crypto.FromECDSAPub(&key.PublicKey))
+ return common.ToHex(crypto.FromECDSAPub(&key.PublicKey))
}
func (self *Whisper) HasIdentity(key string) bool {
@@ -108,9 +108,9 @@ type WhisperMessage struct {
func NewWhisperMessage(msg *whisper.Message) WhisperMessage {
return WhisperMessage{
ref: msg,
- Payload: toHex(msg.Payload),
- From: toHex(crypto.FromECDSAPub(msg.Recover())),
- To: toHex(crypto.FromECDSAPub(msg.To)),
+ Payload: common.ToHex(msg.Payload),
+ From: common.ToHex(crypto.FromECDSAPub(msg.Recover())),
+ To: common.ToHex(crypto.FromECDSAPub(msg.To)),
Sent: msg.Sent,
}
}