Skip to content

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
hsr-22 added a commit to hsr-22/blockchain_go that referenced this pull request Dec 30, 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