-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,810 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/target | ||
/Cargo.lock | ||
/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use solana_sdk::pubkey::Pubkey; | ||
use solana_sdk::signer::Signer; | ||
use std::sync::Arc; | ||
|
||
/// Auxiliary data structure to align the types of the solana-clap-utils with anchor-client. | ||
pub struct DynSigner(pub Arc<dyn Signer>); | ||
|
||
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 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 is_interactive(&self) -> bool { | ||
self.0.is_interactive() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,8 @@ | ||
pub fn add(left: usize, right: usize) -> usize { | ||
left + right | ||
} | ||
#![cfg_attr(not(debug_assertions), deny(warnings))] | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
pub mod dyn_signer; | ||
pub mod marinade; | ||
pub mod rpc_client_helpers; | ||
|
||
#[test] | ||
fn it_works() { | ||
let result = add(2, 2); | ||
assert_eq!(result, 4); | ||
} | ||
} | ||
pub use solana_sdk; | ||
pub use spl_associated_token_account; |
Oops, something went wrong.