impl default version of contains_multiple_slots (#30055)

This commit is contained in:
Jeff Washington (jwash) 2023-02-01 15:01:01 -06:00 committed by GitHub
parent 5769dbf36b
commit 1c4e84b8ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 19 deletions

View File

@ -9536,9 +9536,6 @@ pub mod tests {
fn len(&self) -> usize {
self.1.len()
}
fn contains_multiple_slots(&self) -> bool {
false
}
fn include_slot_in_hash(&self) -> IncludeSlotInHash {
INCLUDE_SLOT_IN_HASH_TESTS
}

View File

@ -1189,9 +1189,6 @@ impl<'a> StorableAccounts<'a, AccountSharedData> for (Slot, &'a [StakeReward], I
fn len(&self) -> usize {
self.1.len()
}
fn contains_multiple_slots(&self) -> bool {
false
}
fn include_slot_in_hash(&self) -> IncludeSlotInHash {
self.2
}

View File

@ -31,7 +31,9 @@ pub trait StorableAccounts<'a, T: ReadableAccount + Sync>: Sync {
fn len(&self) -> usize;
/// are there accounts from multiple slots
/// only used for an assert
fn contains_multiple_slots(&self) -> bool;
fn contains_multiple_slots(&self) -> bool {
false
}
/// true iff hashing these accounts should include the slot
fn include_slot_in_hash(&self) -> IncludeSlotInHash;
@ -87,9 +89,6 @@ impl<'a, T: ReadableAccount + Sync> StorableAccounts<'a, T> for StorableAccounts
fn len(&self) -> usize {
self.accounts.len()
}
fn contains_multiple_slots(&self) -> bool {
false
}
fn include_slot_in_hash(&self) -> IncludeSlotInHash {
self.include_slot_in_hash
}
@ -116,9 +115,6 @@ impl<'a, T: ReadableAccount + Sync> StorableAccounts<'a, T>
fn len(&self) -> usize {
self.1.len()
}
fn contains_multiple_slots(&self) -> bool {
false
}
fn include_slot_in_hash(&self) -> IncludeSlotInHash {
self.2
}
@ -145,9 +141,6 @@ impl<'a> StorableAccounts<'a, StoredAccountMeta<'a>>
fn len(&self) -> usize {
self.1.len()
}
fn contains_multiple_slots(&self) -> bool {
false
}
fn include_slot_in_hash(&self) -> IncludeSlotInHash {
self.2
}
@ -292,9 +285,6 @@ impl<'a> StorableAccounts<'a, StoredAccountMeta<'a>>
fn len(&self) -> usize {
self.1.len()
}
fn contains_multiple_slots(&self) -> bool {
false
}
fn include_slot_in_hash(&self) -> IncludeSlotInHash {
self.2
}