anchor
anchor copied to clipboard
Add support for mock RPC Client in anchor_client
Solana client has a a feature that allows you to generate and use a mock rpc client, which is supremely useful when doing unit tests. Anchor client (as far as I can tell) doesn't support this when using RequestBuilder and instead always uses the passed cluster under the hood:
(https://github.com/coral-xyz/anchor/blob/master/client/src/lib.rs#L641) (https://github.com/coral-xyz/anchor/blob/master/client/src/lib.rs#L650) ... and more
It would be cool if we could pass in an RPCClient instead of a cluster when creating a client to allow for mocking.