Skip to content
New issue

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

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

Already on GitHub? # to your account

Pubkey not allowing to convert to string? #56

Closed
Morgandri1 opened this issue May 23, 2023 · 6 comments
Closed

Pubkey not allowing to convert to string? #56

Morgandri1 opened this issue May 23, 2023 · 6 comments

Comments

@Morgandri1
Copy link
Contributor

Morgandri1 commented May 23, 2023

Getting this error:

AttributeError: 'solders.pubkey.Pubkey' object has no attribute 'string'

when my code is:

from solders.keypair import Keypair

kp = Keypair()
print(kp.pubkey().string())

This error is happening on both 0.14.0 and 0.17.0

@kevinheavey
Copy link
Owner

kevinheavey commented May 23, 2023

use str(key) not key.string(). Did a person or large language model tell you that key.string() was a thing? If so please yell at them

@Morgandri1
Copy link
Contributor Author

No, i just assumed it would work seeing as there's a string method in the pubkey.pyi src. might want to remove that

@kevinheavey
Copy link
Owner

Ah I'll go yell at myself then

@Morgandri1
Copy link
Contributor Author

Morgandri1 commented May 23, 2023

haha, sorry about that.
Its been in releases since at least 0.14.0, so thats where the confusion was

is that an old method?

@kevinheavey
Copy link
Owner

kevinheavey commented May 23, 2023

Thanks for pointing it out! Yes it's old. Happy to accept a PR to delete it from the pyi file, otherwise will look later this week

@kevinheavey
Copy link
Owner

Closed by #57

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

No branches or pull requests

2 participants