kevinheavey / solders

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

Catching PanicException in Keypair.from_base58_string function #122

Open Lusmft opened 2 weeks ago

Lusmft commented 2 weeks ago

If I'm using this function on wrong Base58 Key, i'm getting this:

pyo3_runtime.PanicException: called Result::unwrap() on an Err value: signature::Error { source: Some(Cannot decompress Edwards point) }

And process is lost after this exception.

Lusmft commented 2 weeks ago

For example this key: 2drGAFxvqjtQftmbxbTqmLX5QtpZHJ4Ybzt6nYFXzJ8nccqJivsRrUSozCz5PWpPNjGtMpb4s45VXMpRWRJFxoqM

kevinheavey commented 2 weeks ago

What solders version are you using? This sounds like the issue that was fixed in 0.22: https://github.com/kevinheavey/solders/pull/93

Lusmft commented 2 weeks ago

What solders version are you using? This sounds like the issue that was fixed in 0.22: #93

Yeah, I already found that this problem was solved in 0.22, but unfortunately solana-py use still 0.21 and is not compatible with version 0.22 because of function GetStakeActivationResp from solders.rpc.responses