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)
|
||||
|
||||
// test to see if the account was injected in whisper
|
||||
whisperInstance := (*accountSync)[0].(*whisper.Whisper)
|
||||
identitySucess := whisperInstance.HasIdentity(crypto.ToECDSAPub(common.FromHex(pubkey)))
|
||||
if !identitySucess || err != nil {
|
||||
t.Error("Test failed: identity not injected into whisper")
|
||||
// test to see if the account was injected in whisqer
|
||||
var whisperInstance *whisper.Whisper
|
||||
if err := currentNode.Service(&whisperInstance); err != nil {
|
||||
t.Errorf("whisper service not running: %v", err)
|
||||
}
|
||||
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
|
||||
|
@ -55,7 +58,7 @@ func TestAccountBindings(t *testing.T) {
|
|||
whisperAPI := whisper.NewPublicWhisperAPI(whisperInstance)
|
||||
postSucess, err := whisperAPI.Post(postArgs)
|
||||
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
|
||||
|
@ -63,5 +66,4 @@ func TestAccountBindings(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Error("Test failed: could not clean up temporary datadir")
|
||||
}
|
||||
|
||||
}
|
||||
|
|
18
src/main.go
18
src/main.go
|
@ -5,9 +5,9 @@ import (
|
|||
"fmt"
|
||||
"runtime"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/logger"
|
||||
"github.com/ethereum/go-ethereum/logger/glog"
|
||||
"github.com/ethereum/go-ethereum/node"
|
||||
|
@ -29,14 +29,14 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
vString string // Combined textual representation of the version
|
||||
rConfig release.Config // Structured version information and release oracle config
|
||||
currentNode *node.Node // currently running geth node
|
||||
c *cli.Context // the CLI context used to start the geth node
|
||||
accountSync *[]node.Service // the object used to sync accounts between geth services
|
||||
accountManager *accounts.Manager // the account manager attached to the currentNode
|
||||
whisperService *whisper.Whisper // whisper service
|
||||
datadir string // data directory for geth
|
||||
vString string // Combined textual representation of the version
|
||||
rConfig release.Config // Structured version information and release oracle config
|
||||
currentNode *node.Node // currently running geth node
|
||||
c *cli.Context // the CLI context used to start the geth node
|
||||
accountSync *[]node.Service // the object used to sync accounts between geth services
|
||||
accountManager *accounts.Manager // the account manager attached to the currentNode
|
||||
whisperService *whisper.Whisper // whisper service
|
||||
datadir string // data directory for geth
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
Loading…
Reference in New Issue