Minor updates to make bindings work on updated ethereum branch
This commit is contained in:
parent
a26a3ad649
commit
45ffd5599d
|
@ -37,11 +37,14 @@ func TestAccountBindings(t *testing.T) {
|
||||||
}
|
}
|
||||||
time.Sleep(2 * time.Second)
|
time.Sleep(2 * time.Second)
|
||||||
|
|
||||||
// test to see if the account was injected in whisper
|
// test to see if the account was injected in whisqer
|
||||||
whisperInstance := (*accountSync)[0].(*whisper.Whisper)
|
var whisperInstance *whisper.Whisper
|
||||||
identitySucess := whisperInstance.HasIdentity(crypto.ToECDSAPub(common.FromHex(pubkey)))
|
if err := currentNode.Service(&whisperInstance); err != nil {
|
||||||
if !identitySucess || err != nil {
|
t.Errorf("whisper service not running: %v", err)
|
||||||
t.Error("Test failed: identity not injected into whisper")
|
}
|
||||||
|
identitySucsess := whisperInstance.HasIdentity(crypto.ToECDSAPub(common.FromHex(pubkey)))
|
||||||
|
if !identitySucsess || err != nil {
|
||||||
|
t.Errorf("Test failed: identity not injected into whisper: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// test to see if we can post with the injected whisper identity
|
// test to see if we can post with the injected whisper identity
|
||||||
|
@ -55,7 +58,7 @@ func TestAccountBindings(t *testing.T) {
|
||||||
whisperAPI := whisper.NewPublicWhisperAPI(whisperInstance)
|
whisperAPI := whisper.NewPublicWhisperAPI(whisperInstance)
|
||||||
postSucess, err := whisperAPI.Post(postArgs)
|
postSucess, err := whisperAPI.Post(postArgs)
|
||||||
if !postSucess || err != nil {
|
if !postSucess || err != nil {
|
||||||
t.Error("Test failed: Could not post to whisper")
|
t.Errorf("Test failed: Could not post to whisper: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
|
@ -63,5 +66,4 @@ func TestAccountBindings(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("Test failed: could not clean up temporary datadir")
|
t.Error("Test failed: could not clean up temporary datadir")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/accounts"
|
||||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/accounts"
|
|
||||||
"github.com/ethereum/go-ethereum/logger"
|
"github.com/ethereum/go-ethereum/logger"
|
||||||
"github.com/ethereum/go-ethereum/logger/glog"
|
"github.com/ethereum/go-ethereum/logger/glog"
|
||||||
"github.com/ethereum/go-ethereum/node"
|
"github.com/ethereum/go-ethereum/node"
|
||||||
|
|
Loading…
Reference in New Issue