Add ConfirmedBlock struct, and rework Blocktree apis to include block… (#7004)

* Add RpcConfirmedBlock struct, and rework Blocktree apis to include blockhash info and dummy tx statuses

* Remove unused lifetime
This commit is contained in:
Tyera Eulberg
2019-11-17 20:17:15 -07:00
committed by GitHub
parent b66c03667c
commit 3bc8d78801
6 changed files with 95 additions and 54 deletions

View File

@ -3,6 +3,8 @@ use serde_json::{json, Value};
use solana_sdk::{
clock::{Epoch, Slot},
commitment_config::CommitmentConfig,
hash::Hash,
transaction::{Result, Transaction},
};
use std::{error, fmt, io, net::SocketAddr};
@ -20,6 +22,13 @@ pub struct Response<T> {
pub value: T,
}
#[derive(Debug, Default, PartialEq, Serialize)]
pub struct RpcConfirmedBlock {
pub previous_blockhash: Hash,
pub blockhash: Hash,
pub transactions: Vec<(Transaction, Result<()>)>,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct RpcContactInfo {
/// Pubkey of the node as a base-58 string