coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.36k stars 1.25k forks source link

feat: Add option to pass in rpc client when using anchor_client #3053

Open cryptopapi997 opened 5 days ago

cryptopapi997 commented 5 days ago

Resolves https://github.com/coral-xyz/anchor/issues/3050

vercel[bot] commented 5 days ago

@cryptopapi997 is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

cryptopapi997 commented 4 days ago

I feel like the way it's currently is more general, which in this case is a good thing because it means if the solana mock doesn't support a specific kind of operation anyone can spin up their own adapted mock version and pass it in. The docs for new_mock_with_mocks method themselves also say this

It is primarily for internal use, with limited customizability, and behaviors determined by internal Solana test cases. New users should consider implementing RpcSender themselves and constructing RpcClient with RpcClient::new_sender to get mock behavior.

Happy to rename the feature to mock though if you think that's more clear.