merged from develop

This commit is contained in:
Alexandre Van de Sande 2015-02-06 12:12:02 -02:00
commit b36c72a8ef
7 changed files with 9 additions and 8 deletions

View file

@ -29,7 +29,8 @@
var web3 = require('web3');
var eth = web3.eth;
web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8080'));
web3.setProvider(new
web3.providers.HttpSyncProvider('http://localhost:8545'));
var desc = [{
"name": "balance(address)",
"inputs": [{

View file

@ -15,7 +15,7 @@ if ls $dir/*.go &> /dev/null; then
# echo $dir
if [[ $dir != "./tests/vm" ]]
then
$GOROOT/bin/go test -covermode=count -coverprofile=$dir/profile.tmp $dir
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
$GOROOT/bin/go tool cover -func profile.cov
go tool cover -func profile.cov
# To submit the test coverage result to coveralls.io,
# use goveralls (https://github.com/mattn/goveralls)

View file

@ -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.ToECDSA(fromHex(to))
f.To = crypto.ToECDSAPub(fromHex(to))
}
if from, ok := opts["from"].(string); ok {
f.From = crypto.ToECDSAPub(fromHex(from))

View file

@ -3,7 +3,7 @@ package whisper
import "crypto/ecdsa"
type Filter struct {
To *ecdsa.PrivateKey
To *ecdsa.PublicKey
From *ecdsa.PublicKey
Topics [][]byte
Fn func(*Message)

View file

@ -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.FromECDSA(opts.To)),
Str1: string(crypto.FromECDSAPub(opts.To)),
Str2: string(crypto.FromECDSAPub(opts.From)),
Data: bytesToMap(opts.Topics),
Fn: func(data interface{}) {

View file

@ -11,7 +11,7 @@ func TestEvent(t *testing.T) {
whisper := New()
id := whisper.NewIdentity()
whisper.Watch(Filter{
To: id,
To: &id.PublicKey,
Fn: func(msg *Message) {
res <- msg
},

View file

@ -65,7 +65,7 @@ func (self *Whisper) HasIdentity(key string) bool {
func (self *Whisper) Watch(opts *Options) int {
filter := whisper.Filter{
To: crypto.ToECDSA(fromHex(opts.To)),
To: crypto.ToECDSAPub(fromHex(opts.To)),
From: crypto.ToECDSAPub(fromHex(opts.From)),
Topics: whisper.TopicsFromString(opts.Topics...),
}