This commit is contained in:
Michael Vines
2020-12-13 17:26:34 -08:00
parent 0d139d7ef3
commit 7143aaa89b
102 changed files with 543 additions and 499 deletions

View File

@ -309,9 +309,11 @@ mod tests {
fn test_fee_rate_governor_derived_adjust() {
solana_logger::setup();
let mut f = FeeRateGovernor::default();
f.target_lamports_per_signature = 100;
f.target_signatures_per_slot = 100;
let mut f = FeeRateGovernor {
target_lamports_per_signature: 100,
target_signatures_per_slot: 100,
..FeeRateGovernor::default()
};
f = FeeRateGovernor::new_derived(&f, 0);
// Ramp fees up

View File

@ -109,9 +109,11 @@ mod tests {
(0, true)
);
let mut custom_rent = Rent::default();
custom_rent.lamports_per_byte_year = 5;
custom_rent.exemption_threshold = 2.5;
let custom_rent = Rent {
lamports_per_byte_year: 5,
exemption_threshold: 2.5,
..Rent::default()
};
assert_eq!(
custom_rent.due(0, 2, 1.2),

View File

@ -199,6 +199,7 @@ impl<'de, T: Deserialize<'de>> Deserialize<'de> for ShortVec<T> {
}
/// Return the decoded value and how many bytes it consumed.
#[allow(clippy::result_unit_err)]
pub fn decode_len(bytes: &[u8]) -> Result<(usize, usize), ()> {
let mut len = 0;
let mut size = 0;

View File

@ -136,7 +136,7 @@ pub fn create_test_recent_blockhashes(start: usize) -> RecentBlockhashes {
.iter()
.map(|(i, hash, fee_calc)| IterItem(*i, hash, fee_calc))
.collect();
RecentBlockhashes::from_iter(bhq.into_iter())
bhq.into_iter().collect()
}
#[cfg(test)]