Jeiwan / blockchain_go

A simplified blockchain implementation in Golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gob: type elliptic.p256Curve has no exported fields

mithleshmeghwal0 opened this issue · comments

part_5 createwallet not working @Jeiwan

commented

@mithleshmeghwal0 Which code section?

@BryceWayne

log.Panic(err)

its failing on this line
Screeshot is from my local, so line number may differ
Screenshot 2565-12-26 at 11 34 34

commented

elliptic.p256Curve should have no exported fields, right? Because of p being lowercase. Inspecting further.

Yup, i inspected until this point, but can we do any work around this ?

commented

For context, https://stackoverflow.com/questions/32676898/whats-the-purpose-of-gob-register-method
The problem is saving the wallets map so that we can always reconstruct the data... Just thinking out loud.

commented

One way might be to create your own type/interface to access to field...
https://stackoverflow.com/questions/42664837/how-to-access-unexported-struct-fields

Yup, i will try to create interface and i will comment or probably create PR for this . Thanks @BryceWayne

@BryceWayne i tried to build a package with elliptic , but it still failed
@Jeiwan

@BryceWayne

log.Panic(err)

its failing on this line
Screeshot is from my local, so line number may differ
Screenshot 2565-12-26 at 11 34 34

Did you fix these,please?

Seems @LangLiBa this repo is outdated, i created this issue long ago, there is no reply. I fixed this by using 1.18.9 go version.
I could have pursued to fix this, but my objective was to learn blockchain, not to fix this

Seems @LangLiBa this repo is outdated, i created this issue long ago, there is no reply. I fixed this by using 1.18.9 go version. I could have pursued to fix this, but my objective was to learn blockchain, not to fix this

Ok, thanks a lot.

commented

Seems @LangLiBa this repo is outdated, i created this issue long ago, there is no reply. I fixed this by using 1.18.9 go version. I could have pursued to fix this, but my objective was to learn blockchain, not to fix this

Thanks @mithleshmeghwal0

I'm getting the same error, how should I fix this problem

Is there another solution? Or please update the code based on the latest go version?thx.

Here is my workaround (see lns 89-143). Then remove ln 66 and ln 82 from wallets.go.

I implemented GobEncoder/GobDecoder interfaces to the Wallet struct so gob.Register(elliptic.P256()) can be removed.