Update fee api to use blockhash (#21054)

This commit is contained in:
Jack May
2021-10-29 13:52:59 -07:00
committed by GitHub
parent aea3c66fa8
commit bced07a099
16 changed files with 142 additions and 93 deletions

View File

@ -245,6 +245,14 @@ impl Message {
}
pub fn new(instructions: &[Instruction], payer: Option<&Pubkey>) -> Self {
Self::new_with_blockhash(instructions, payer, &Hash::default())
}
pub fn new_with_blockhash(
instructions: &[Instruction],
payer: Option<&Pubkey>,
blockhash: &Hash,
) -> Self {
let InstructionKeys {
mut signed_keys,
unsigned_keys,
@ -259,7 +267,7 @@ impl Message {
num_readonly_signed_accounts,
num_readonly_unsigned_accounts,
signed_keys,
Hash::default(),
*blockhash,
instructions,
)
}