blocto / solana-go-sdk

Solana Golang SDK
https://blocto.github.io/solana-go-sdk/
MIT License
366 stars 95 forks source link

Export an interface for the client instead of a struct #102

Open fgarciareyna opened 1 year ago

fgarciareyna commented 1 year ago

Hey team! I was trying to make an interface for the Client struct because I want to mock it for testing proposes, but I get stuck because the client exports the RpcClient field.

If you don't want to make the breaking changes needed to make the interface, you can just add a GetRpcClient() method to the Client. (That's quite easy and fully backwards compatible, but not the most pretty or idiomatic solution)

yihau commented 1 year ago

oh yeah. export an interface will be more easy to do some mock. will add them in next few release.