Extend GetBlockHash RPC API to include the fee scehdule for using the returned blockhash (#4222)

This commit is contained in:
Michael Vines
2019-05-13 12:49:37 -07:00
committed by GitHub
parent 23c696706b
commit a2e3a92b01
17 changed files with 126 additions and 98 deletions

View File

@ -7,6 +7,7 @@
//! Asynchronous implementations are expected to create transactions, sign them, and send
//! them but without waiting to see if the server accepted it.
use crate::fee_calculator::FeeCalculator;
use crate::hash::Hash;
use crate::instruction::Instruction;
use crate::message::Message;
@ -46,7 +47,7 @@ pub trait SyncClient {
) -> Result<Option<transaction::Result<()>>>;
/// Get recent blockhash
fn get_recent_blockhash(&self) -> Result<Hash>;
fn get_recent_blockhash(&self) -> Result<(Hash, FeeCalculator)>;
/// Get transaction count
fn get_transaction_count(&self) -> Result<u64>;
@ -61,7 +62,7 @@ pub trait SyncClient {
/// Poll to confirm a transaction.
fn poll_for_signature(&self, signature: &Signature) -> Result<()>;
fn get_new_blockhash(&self, blockhash: &Hash) -> Result<Hash>;
fn get_new_blockhash(&self, blockhash: &Hash) -> Result<(Hash, FeeCalculator)>;
}
pub trait AsyncClient {

View File

@ -1,6 +1,7 @@
use crate::message::Message;
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
#[serde(rename_all = "camelCase")]
pub struct FeeCalculator {
pub lamports_per_signature: u64,
}