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

gob: type elliptic.p256Curve has no exported fields #85

Open
mithleshmeghwal0 opened this issue Dec 26, 2022 · 20 comments · May be fixed by #92
Open

gob: type elliptic.p256Curve has no exported fields #85

mithleshmeghwal0 opened this issue Dec 26, 2022 · 20 comments · May be fixed by #92

Comments

@mithleshmeghwal0
Copy link

mithleshmeghwal0 commented Dec 26, 2022

part_5 createwallet not working @Jeiwan

@Anmilover
Copy link

Anmilover commented Dec 26, 2022 via email

@BryceWayne
Copy link

@mithleshmeghwal0 Which code section?

@mithleshmeghwal0
Copy link
Author

mithleshmeghwal0 commented Dec 26, 2022

@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

@BryceWayne
Copy link

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

@BryceWayne
Copy link

Here is why. https://cs.opensource.google/go/go/+/refs/tags/go1.19.4:src/crypto/elliptic/nistec.go;l=35;drc=38cfb3be9d486833456276777155980d1ec0823e

The field is not accessible outside the file.

@mithleshmeghwal0
Copy link
Author

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

@BryceWayne
Copy link

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.

@BryceWayne
Copy link

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

@mithleshmeghwal0
Copy link
Author

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

@mithleshmeghwal0
Copy link
Author

mithleshmeghwal0 commented Dec 28, 2022

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

@LangLiBa
Copy link

LangLiBa commented Jan 11, 2023

@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?

@Anmilover
Copy link

Anmilover commented Jan 11, 2023 via email

@mithleshmeghwal0
Copy link
Author

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

@LangLiBa
Copy link

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.

@BryceWayne
Copy link

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

@zzylmt
Copy link

zzylmt commented Oct 18, 2023

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

@Anmilover
Copy link

Anmilover commented Oct 18, 2023 via email

@zzylmt
Copy link

zzylmt commented Oct 18, 2023

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

@atsuyaourt
Copy link

atsuyaourt commented Dec 29, 2023

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.

@Anmilover
Copy link

Anmilover commented Dec 29, 2023 via email

@mubarizkyc mubarizkyc linked a pull request Jun 20, 2024 that will close this issue
BHare1985 added a commit to BHare1985/bcsos that referenced this issue Aug 1, 2024
elliptic.p256Curve has no exported fields
See Jeiwan/blockchain_go#85
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

Successfully merging a pull request may close this issue.

6 participants