sdk: Move `signers` module into `signer` module

This commit is contained in:
Trent Nelson 2021-05-07 02:33:37 -06:00 committed by Trent Nelson
parent b71e4bdc61
commit 967840aed6
3 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,8 @@
// Allows macro expansion of `use ::solana_sdk::*` to work within this crate // Allows macro expansion of `use ::solana_sdk::*` to work within this crate
extern crate self as solana_sdk; extern crate self as solana_sdk;
#[cfg(feature = "full")]
pub use signer::signers;
pub use solana_program::*; pub use solana_program::*;
pub mod account; pub mod account;
@ -41,7 +43,6 @@ pub mod secp256k1_instruction;
pub mod shred_version; pub mod shred_version;
pub mod signature; pub mod signature;
pub mod signer; pub mod signer;
pub mod signers;
pub mod stake_weighted_timestamp; pub mod stake_weighted_timestamp;
pub mod system_transaction; pub mod system_transaction;
pub mod timing; pub mod timing;

View File

@ -13,6 +13,7 @@ use {
pub mod keypair; pub mod keypair;
pub mod null_signer; pub mod null_signer;
pub mod presigner; pub mod presigner;
pub mod signers;
#[derive(Debug, Error, PartialEq)] #[derive(Debug, Error, PartialEq)]
pub enum SignerError { pub enum SignerError {

View File

@ -4,6 +4,7 @@ use crate::{
signature::{Signature, Signer, SignerError}, signature::{Signature, Signer, SignerError},
}; };
/// Convenience trait for working with mixed collections of `Signer`s
pub trait Signers { pub trait Signers {
fn pubkeys(&self) -> Vec<Pubkey>; fn pubkeys(&self) -> Vec<Pubkey>;
fn try_pubkeys(&self) -> Result<Vec<Pubkey>, SignerError>; fn try_pubkeys(&self) -> Result<Vec<Pubkey>, SignerError>;