kevinheavey / solders

A high-performance Python toolkit for Solana, written in Rust
https://kevinheavey.github.io/solders/
Apache License 2.0
232 stars 26 forks source link

Pubkey not allowing to convert to string? #56

Closed Morgandri1 closed 1 year ago

Morgandri1 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Ah I'll go yell at myself then

Morgandri1 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Closed by #57