I am trying to convert a public key saved as a string to an anchor_lang PubKey object in rust. What is the procedure to convert a string to a PubKey object?
CodePudding user response:
I've never used solana before, so I am not sure exactly how one would do this. Looking through their docs, it looks like PubKey
implements the FromStr
trait. This has a from_str function that takes a &str
and parses it into a PubKey
.