diff options
-rw-r--r-- | crypto/encrypt_decrypt_test.go | 2 | ||||
-rw-r--r-- | ui/qt/qwhisper/whisper.go | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/crypto/encrypt_decrypt_test.go b/crypto/encrypt_decrypt_test.go index 850fa94e4..85b43c406 100644 --- a/crypto/encrypt_decrypt_test.go +++ b/crypto/encrypt_decrypt_test.go @@ -11,7 +11,7 @@ import ( func TestBox(t *testing.T) { prv1 := ToECDSA(ethutil.Hex2Bytes("4b50fa71f5c3eeb8fdc452224b2395af2fcc3d125e06c32c82e048c0559db03f")) prv2 := ToECDSA(ethutil.Hex2Bytes("d0b043b4c5d657670778242d82d68a29d25d7d711127d17b8e299f156dad361a")) - pub2 := PubToECDSA(ethutil.Hex2Bytes("04bd27a63c91fe3233c5777e6d3d7b39204d398c8f92655947eb5a373d46e1688f022a1632d264725cbc7dc43ee1cfebde42fa0a86d08b55d2acfbb5e9b3b48dc5")) + pub2 := ToECDSAPub(ethutil.Hex2Bytes("04bd27a63c91fe3233c5777e6d3d7b39204d398c8f92655947eb5a373d46e1688f022a1632d264725cbc7dc43ee1cfebde42fa0a86d08b55d2acfbb5e9b3b48dc5")) message := []byte("Hello, world.") ct, err := Encrypt(pub2, message) diff --git a/ui/qt/qwhisper/whisper.go b/ui/qt/qwhisper/whisper.go index d307366c8..bed23c8a7 100644 --- a/ui/qt/qwhisper/whisper.go +++ b/ui/qt/qwhisper/whisper.go @@ -3,6 +3,7 @@ package qwhisper import ( "time" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/whisper" ) @@ -27,7 +28,7 @@ func (self *Whisper) Post(data string, pow, ttl uint32, to, from string) { msg := whisper.NewMessage(fromHex(data)) envelope, err := msg.Seal(time.Duration(pow), whisper.Opts{ Ttl: time.Duration(ttl), - To: crypto.PubTECDSA(fromHex(to)), + To: crypto.ToECDSAPub(fromHex(to)), From: crypto.ToECDSA(fromHex(from)), }) if err != nil { @@ -35,7 +36,7 @@ func (self *Whisper) Post(data string, pow, ttl uint32, to, from string) { return } - if err := self.Whisper.Send(envolpe); err != nil { + if err := self.Whisper.Send(envelope); err != nil { // handle error return } @@ -51,20 +52,19 @@ func (self *Whisper) HasIdentify(key string) bool { func (self *Whisper) Watch(opts map[string]interface{}) { filter := filterFromMap(opts) - filter.Fn = func(msg *Message) { + filter.Fn = func(msg *whisper.Message) { // TODO POST TO QT WINDOW } - self.Watch(filter) + self.Whisper.Watch(filter) } -func filterFromMap(opts map[string]interface{}) whisper.Filter { - var f Filter +func filterFromMap(opts map[string]interface{}) (f whisper.Filter) { if to, ok := opts["to"].(string); ok { - f.To = ToECDSA(fromHex(to)) + f.To = crypto.ToECDSA(fromHex(to)) } if from, ok := opts["from"].(string); ok { - f.From = ToECDSAPub(fromHex(from)) + f.From = crypto.ToECDSAPub(fromHex(from)) } - return f + return } |