workbenchapp / solana-workbench

Your one-stop shop for developing on Solana
MIT License
63 stars 7 forks source link

Pubkey validation added to WatchAccountPopover #217

Closed sammanadh closed 2 years ago

sammanadh commented 2 years ago

Mistakeny added a invalid public key in watchAccountPopover which caused the entire app to break. Screenshot from 2022-07-13 17-50-22 I guess when I added the invalid address to watch, it got stored and is causing this issue even after I restart the app. Next, I will clear stored address from memory, and figure our any measures we can take if such address somehow gets stored. But, for now, this PR should prevent user from entering the invalid address.

sammanadh commented 2 years ago

Ohh. It uses localstorage. For now the best place to validate public key seemes to the the pinAccount function. But I think implementing a redux middleware that makes sure the all the states that store addresses gets valid public key would be the best approach.

nathanleclaire commented 2 years ago

Looks great, thanks.

I think implementing a redux middleware that makes sure the all the states that store addresses gets valid public key would be the best approach.

Agreed, that might be a good follow up to work on if you're interested

One change around typing requested then LGTM

nathanleclaire commented 2 years ago

Almost there! Just one request to get rid of the !!validationError which was the idea behind making the type string | undefined

nathanleclaire commented 2 years ago

Oh nice, I can just edit your repo 🤯

LGTM