reestablish parameter semantics for withdraw (#6330)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
use crate::hash::Hash;
|
||||
use crate::{clock::Epoch, pubkey::Pubkey};
|
||||
use std::{cmp, fmt};
|
||||
use std::{cmp, fmt, iter::FromIterator};
|
||||
|
||||
/// An Account with data that is stored on chain
|
||||
#[repr(C)]
|
||||
@ -196,3 +196,15 @@ pub fn create_keyed_credit_only_accounts(accounts: &mut [(Pubkey, Account)]) ->
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Return all the signers from a set of KeyedAccounts
|
||||
pub fn get_signers<A>(keyed_accounts: &[KeyedAccount]) -> A
|
||||
where
|
||||
A: FromIterator<Pubkey>,
|
||||
{
|
||||
keyed_accounts
|
||||
.iter()
|
||||
.filter_map(|keyed_account| keyed_account.signer_key())
|
||||
.cloned()
|
||||
.collect::<A>()
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
use crate::account::KeyedAccount;
|
||||
use crate::instruction::InstructionError;
|
||||
use crate::pubkey::Pubkey;
|
||||
use crate::{account::KeyedAccount, instruction::InstructionError, pubkey::Pubkey};
|
||||
use num_traits::{FromPrimitive, ToPrimitive};
|
||||
|
||||
// All native programs export a symbol named process()
|
||||
|
Reference in New Issue
Block a user