Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl signer now includes deref impl signer #2706

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cavemanloverboy
Copy link
Contributor

Now that Signer is implemented for all Deref<Target = impl Signer> within solana-sdk, we can remove this from the client without introducing breaking changes. This simplifies the code and allows rust-analyzer to better infer types.

Copy link

vercel bot commented Nov 18, 2023

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

A member of the Team first needs to authorize it.

Copy link
Collaborator

@acheroncrypto acheroncrypto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that Signer is implemented for all Deref<Target = impl Signer> within solana-sdk, we can remove this from the client without introducing breaking changes.

Unfortunately not because solana-labs/solana#32181 requires ^1.17 but we still support 1.16.

Also, nonblocking client needs to be updated too.

@cavemanloverboy
Copy link
Contributor Author

Now that Signer is implemented for all Deref<Target = impl Signer> within solana-sdk, we can remove this from the client without introducing breaking changes.

Unfortunately not because solana-labs/solana#32181 requires ^1.17 but we still support 1.16.

Also, nonblocking client needs to be updated too.

updated nonblocking client, and removed unused Deref import. I guess we can wait until 1.17 ships?

@acheroncrypto
Copy link
Collaborator

updated nonblocking client, and removed unused Deref import. I guess we can wait until 1.17 ships?

Yes, I think it's better to wait until 1.17 adoption before we make it the minimum version.

@cavemanloverboy
Copy link
Contributor Author

updated nonblocking client, and removed unused Deref import. I guess we can wait until 1.17 ships?

Yes, I think it's better to wait until 1.17 adoption before we make it the minimum version.

🫡

@cavemanloverboy
Copy link
Contributor Author

this may be ready to go soon

@cavemanloverboy
Copy link
Contributor Author

bump

@acheroncrypto acheroncrypto added the next Required for the next release label Mar 9, 2024
Comment on lines -101 to +128
/// Auxiliary data structure to align the types of the Solana CLI utils with Anchor client.
/// Client<C> implementation requires <C: Clone + Deref<Target = impl Signer>> which does not comply with Box<dyn Signer>
/// that's used when loaded Signer from keypair file. This struct is used to wrap the usage.
pub struct DynSigner(pub Arc<dyn Signer>);
// /// Auxiliary data structure to align the types of the Solana CLI utils with Anchor client.
// /// Client<C> implementation requires <C: Clone + impl Signer> which does not comply with Box<dyn Signer>
// /// that's used when loaded Signer from keypair file. This struct is used to wrap the usage.
// pub struct DynSigner(pub Arc<dyn Signer>);

impl Signer for DynSigner {
fn pubkey(&self) -> Pubkey {
self.0.pubkey()
}
// impl Signer for DynSigner {
// fn pubkey(&self) -> Pubkey {
// self.0.pubkey()
// }

fn try_pubkey(&self) -> Result<Pubkey, solana_sdk::signer::SignerError> {
self.0.try_pubkey()
}
// fn try_pubkey(&self) -> Result<Pubkey, solana_sdk::signer::SignerError> {
// self.0.try_pubkey()
// }

fn sign_message(&self, message: &[u8]) -> solana_sdk::signature::Signature {
self.0.sign_message(message)
}
// fn sign_message(&self, message: &[u8]) -> solana_sdk::signature::Signature {
// self.0.sign_message(message)
// }

fn try_sign_message(
&self,
message: &[u8],
) -> Result<solana_sdk::signature::Signature, solana_sdk::signer::SignerError> {
self.0.try_sign_message(message)
}
// fn try_sign_message(
// &self,
// message: &[u8],
// ) -> Result<solana_sdk::signature::Signature, solana_sdk::signer::SignerError> {
// self.0.try_sign_message(message)
// }

fn is_interactive(&self) -> bool {
self.0.is_interactive()
}
}
// fn is_interactive(&self) -> bool {
// self.0.is_interactive()
// }
// }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing DynSigner is no longer required? If so, we should remove it instead of commenting it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. i'll take a look at this again

@acheroncrypto acheroncrypto removed the next Required for the next release label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants