Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*wallet.ReadableWallet is not wallet.Wallet: missing method AddEntry #16

Closed
Craig-Macomber opened this issue Mar 23, 2014 · 5 comments
Closed

Comments

@Craig-Macomber
Copy link

I get this panic printed out ever second or so when I run: ./run.sh -web-interface=true

I'm at commit a90649c: use deterministic wallet

[skycoin.daemon:INFO] Requesting DHT Peers
2014/03/23 16:34:31 http: panic serving 127.0.0.1:34004: interface conversion: _wallet.ReadableWallet is not wallet.Wallet: missing method AddEntry
goroutine 124 [running]:
net/http.func·009()
/usr/local/go/src/pkg/net/http/server.go:1093 +0xae
runtime.panic(0x798160, 0xc2105bda00)
/usr/local/go/src/pkg/runtime/panic.c:248 +0x106
github.com/skycoin/skycoin/src/gui.walletHandlerPOST(0xc210091240, 0x7fe1145e6bc8, 0xc2105d8c80, 0xc2105bfc30)
/home/craig/sky/src/github.com/skycoin/skycoin/src/gui/wallet.go:74 +0xf3
github.com/skycoin/skycoin/src/gui.func·010(0x7fe1145e6bc8, 0xc2105d8c80, 0xc2105bfc30)
/home/craig/sky/src/github.com/skycoin/skycoin/src/gui/wallet.go:103 +0x14f
net/http.HandlerFunc.ServeHTTP(0xc210094800, 0x7fe1145e6bc8, 0xc2105d8c80, 0xc2105bfc30)
/usr/local/go/src/pkg/net/http/server.go:1220 +0x40
net/http.(_ServeMux).ServeHTTP(0xc2100974b0, 0x7fe1145e6bc8, 0xc2105d8c80, 0xc2105bfc30)
/usr/local/go/src/pkg/net/http/server.go:1496 +0x163
net/http.serverHandler.ServeHTTP(0xc21001ea00, 0x7fe1145e6bc8, 0xc2105d8c80, 0xc2105bfc30)
/usr/local/go/src/pkg/net/http/server.go:1597 +0x16e
net/http.(_conn).serve(0xc2105cee00)
/usr/local/go/src/pkg/net/http/server.go:1167 +0x7b7
created by net/http.(_Server).Serve
/usr/local/go/src/pkg/net/http/server.go:1644 +0x28b
[skycoin.daemon:INFO] Requesting DHT Peers

@skycoin-main
Copy link
Contributor

pull again, then run

./compile/clean-static-libs.sh
./compile/get-dependencies.sh

Sometimes, golang does not recompile libraries after the source code is updated.

@Craig-Macomber
Copy link
Author

That didn't fix it. Since you seem to think this is likely build related, I'll review the setup process again. I didn't exactly follow your guide, so this could be my fault. I'll update this again if I learn more.

@Craig-Macomber
Copy link
Author

I added:
var _ Wallet = &ReadableWallet{}
to readable.go and it appears that ReadableWallet is missing lots of methods from Wallet.

So is the error here that (1) it should not be using ReadableWallet as a Wallet, OR (2) that ReadableWallet is supposed to implement Wallet (which it does not).

If the error is (2), you can add "var _ Wallet = &ReadableWallet{}" to readable.go to catch such issues at compile time.

I also tried deleteing all files in ~/.skycoin/ and it did not help.

gateway.CreateWallet is commented as returning a *ReadableWallet, which is what it does return. walletHandlerPOST then tries to use it as a Wallet (so it can call "SetName"), which *ReadableWallet is not.

I replaced the relevant code (where the panic trace points) in walletHandlerPOST (which used to type assert to wallet.Wallet) with:

    iw := gateway.CreateWallet()
    if iw != nil {
        w := iw.(*wallet.ReadableWallet)
        w.Name = name
    }

which does not panic, but does not save the wallet (I see no same methods on wallet.ReadableWallet). This at least lets me have an address show up in the GUI.

I don't think this is a build or configuration issue. The latest code on github seems to agree with what I'm seeing locally.

Anyway, I don't know my way around the code yet, so I can't do much more than that.

@Craig-Macomber
Copy link
Author

I'm still seeing this error. Looks like its line 75 now though: src/gui/wallet.go:75
I'm at commit b137a17

It now only seems to happen when I press "New Wallet", which then creates 2 additional wallets (it used to not appear to add any wallets).

@skycoin-main
Copy link
Contributor

Wallet is undergoing refactoring to use the new deterministic wallets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants