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

fix: gob: type elliptic.p256Curve has no exported fields. #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Gezelligheid1010
Copy link

When I read the wallet file using the code in the original code, I encountered this error:
gob: type elliptic.p256Curve has no exported fields.
This is due to the fact that the elliptic.p256Curve type in the crypto/elliptic package has no exported fields, whereas the Gob encoder requires that all fields in the struct must be exported.
So I defined an exportable type, SerializableWallet, to store the parameters of the elliptic curve, and modified the decoding and encoding parts of the LoadFromFile and SaveToFile methods.

When I read the wallet file using the code in the original code, I encountered this error: gob: type elliptic.p256Curve has no exported fields.
This is due to the fact that the elliptic.p256Curve type in the crypto/elliptic package has no exported fields, whereas the Gob encoder requires that all fields in the struct must be exported.
So I defined an exportable type, SerializableWallet, to store the parameters of the elliptic curve, and modified the decoding and encoding parts of the LoadFromFile and SaveToFile methods.
@Gezelligheid1010 Gezelligheid1010 changed the title Solve gob: type elliptic.p256Curve has no exported fields. fix: gob: type elliptic.p256Curve has no exported fields. Sep 20, 2024
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 this pull request may close these issues.

1 participant