Additional tests for should_retransmit_and_persist (#6062)

automerge
This commit is contained in:
Pankaj Garg
2019-09-24 14:54:10 -07:00
committed by Grimes
parent 9d805dfc59
commit 5763d63737
2 changed files with 40 additions and 14 deletions

View File

@@ -23,7 +23,7 @@ lazy_static! {
{ serialized_size(&DataShredHeader::default()).unwrap() as usize };
static ref SIZE_OF_SIGNATURE: usize =
{ bincode::serialized_size(&Signature::default()).unwrap() as usize };
static ref SIZE_OF_SHRED_TYPE: usize = { bincode::serialized_size(&0u8).unwrap() as usize };
pub static ref SIZE_OF_SHRED_TYPE: usize = { bincode::serialized_size(&0u8).unwrap() as usize };
}
thread_local!(static PAR_THREAD_POOL: RefCell<ThreadPool> = RefCell::new(rayon::ThreadPoolBuilder::new()
@@ -334,7 +334,7 @@ impl Shredder {
}
}
fn sign_shred(signer: &Arc<Keypair>, shred_info: &mut Shred, signature_offset: usize) {
pub fn sign_shred(signer: &Arc<Keypair>, shred_info: &mut Shred, signature_offset: usize) {
let data_offset = signature_offset + *SIZE_OF_SIGNATURE;
let signature = signer.sign_message(&shred_info.payload[data_offset..]);
let serialized_signature =