From 1c7a46ec410f74d1f36b4a320ffc0a322100a9ce Mon Sep 17 00:00:00 2001 From: Alexandre Van de Sande Date: Fri, 6 Feb 2015 18:55:05 -0200 Subject: [PATCH] Revert 9505922..b36c72a This rolls back to commit 95059226a90e7adc56ed66c7d5da53c9294e568b. --- cmd/mist/assets/examples/coin.html | 3 +-- gocoverage.sh | 4 ++-- ui/qt/qwhisper/whisper.go | 2 +- whisper/filter.go | 2 +- whisper/whisper.go | 2 +- whisper/whisper_test.go | 2 +- xeth/whisper.go | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cmd/mist/assets/examples/coin.html b/cmd/mist/assets/examples/coin.html index 0cffb36810..edeabe5e86 100644 --- a/cmd/mist/assets/examples/coin.html +++ b/cmd/mist/assets/examples/coin.html @@ -29,8 +29,7 @@ var web3 = require('web3'); var eth = web3.eth; - web3.setProvider(new - web3.providers.HttpSyncProvider('http://localhost:8545')); + web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8080')); var desc = [{ "name": "balance(address)", "inputs": [{ diff --git a/gocoverage.sh b/gocoverage.sh index 24c8e92801..f908a2d669 100755 --- a/gocoverage.sh +++ b/gocoverage.sh @@ -15,7 +15,7 @@ if ls $dir/*.go &> /dev/null; then # echo $dir if [[ $dir != "./tests/vm" ]] then - go test -covermode=count -coverprofile=$dir/profile.tmp $dir + $GOROOT/bin/go test -covermode=count -coverprofile=$dir/profile.tmp $dir fi if [ -f $dir/profile.tmp ] then @@ -25,7 +25,7 @@ if ls $dir/*.go &> /dev/null; then fi done -go tool cover -func profile.cov +$GOROOT/bin/go tool cover -func profile.cov # To submit the test coverage result to coveralls.io, # use goveralls (https://github.com/mattn/goveralls) diff --git a/ui/qt/qwhisper/whisper.go b/ui/qt/qwhisper/whisper.go index 2bc455b0bb..98bfc69b0f 100644 --- a/ui/qt/qwhisper/whisper.go +++ b/ui/qt/qwhisper/whisper.go @@ -106,7 +106,7 @@ func (self *Whisper) Messages(id int) (messages *ethutil.List) { func filterFromMap(opts map[string]interface{}) (f whisper.Filter) { if to, ok := opts["to"].(string); ok { - f.To = crypto.ToECDSAPub(fromHex(to)) + f.To = crypto.ToECDSA(fromHex(to)) } if from, ok := opts["from"].(string); ok { f.From = crypto.ToECDSAPub(fromHex(from)) diff --git a/whisper/filter.go b/whisper/filter.go index b33f2c1a25..4315aa5569 100644 --- a/whisper/filter.go +++ b/whisper/filter.go @@ -3,7 +3,7 @@ package whisper import "crypto/ecdsa" type Filter struct { - To *ecdsa.PublicKey + To *ecdsa.PrivateKey From *ecdsa.PublicKey Topics [][]byte Fn func(*Message) diff --git a/whisper/whisper.go b/whisper/whisper.go index d7d1276d4e..8eab0825b6 100644 --- a/whisper/whisper.go +++ b/whisper/whisper.go @@ -118,7 +118,7 @@ func (self *Whisper) GetIdentity(key *ecdsa.PublicKey) *ecdsa.PrivateKey { func (self *Whisper) Watch(opts Filter) int { return self.filters.Install(filter.Generic{ - Str1: string(crypto.FromECDSAPub(opts.To)), + Str1: string(crypto.FromECDSA(opts.To)), Str2: string(crypto.FromECDSAPub(opts.From)), Data: bytesToMap(opts.Topics), Fn: func(data interface{}) { diff --git a/whisper/whisper_test.go b/whisper/whisper_test.go index 3e3945a0a6..c5ad730216 100644 --- a/whisper/whisper_test.go +++ b/whisper/whisper_test.go @@ -11,7 +11,7 @@ func TestEvent(t *testing.T) { whisper := New() id := whisper.NewIdentity() whisper.Watch(Filter{ - To: &id.PublicKey, + To: id, Fn: func(msg *Message) { res <- msg }, diff --git a/xeth/whisper.go b/xeth/whisper.go index 352e3ed704..32ad1332b6 100644 --- a/xeth/whisper.go +++ b/xeth/whisper.go @@ -65,7 +65,7 @@ func (self *Whisper) HasIdentity(key string) bool { func (self *Whisper) Watch(opts *Options) int { filter := whisper.Filter{ - To: crypto.ToECDSAPub(fromHex(opts.To)), + To: crypto.ToECDSA(fromHex(opts.To)), From: crypto.ToECDSAPub(fromHex(opts.From)), Topics: whisper.TopicsFromString(opts.Topics...), }