Skip to content

Commit

Permalink
remove trait duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsutton committed Jun 23, 2023
1 parent 2f77b93 commit b46f6a2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion consensus/src/model/stores/relations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub trait RelationsStoreReader {

/// Low-level write API for `RelationsStore`
pub trait RelationsStore: RelationsStoreReader {
type DefaultWriter: DbWriter + DirectWriter;
type DefaultWriter: DirectWriter;
fn default_writer(&self) -> Self::DefaultWriter;

fn set_parents(&mut self, writer: impl DbWriter, hash: Hash, parents: BlockHashes) -> Result<(), StoreError>;
Expand Down
4 changes: 2 additions & 2 deletions consensus/src/processes/reachability/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use kaspa_consensus_core::{
blockhash::{BlockHashExtensions, BlockHashes, ORIGIN},
BlockHashMap, BlockHashSet,
};
use kaspa_database::prelude::{DbWriter, DirectWriter, StoreError};
use kaspa_database::prelude::{DirectWriter, StoreError};
use kaspa_hashes::Hash;
use std::collections::{
hash_map::Entry::{Occupied, Vacant},
Expand Down Expand Up @@ -120,7 +120,7 @@ impl<'a, T: ReachabilityStore + ?Sized, S: RelationsStore + ?Sized> DagBuilder<'
self.delete_block_with_writer(self.relations.default_writer(), hash)
}

pub fn delete_block_with_writer(&mut self, writer: impl DbWriter + DirectWriter, hash: Hash) -> &mut Self {
pub fn delete_block_with_writer(&mut self, writer: impl DirectWriter, hash: Hash) -> &mut Self {
let mergeset = delete_reachability_relations(writer, self.relations, self.reachability, hash);
delete_block(self.reachability, hash, &mut mergeset.iter().cloned()).unwrap();
self
Expand Down
4 changes: 2 additions & 2 deletions consensus/src/processes/relations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn init<S: RelationsStore + ?Sized>(relations: &mut S) {
/// (and writes will not accumulate if the entry gets out of the cache in between the calls)
pub fn delete_level_relations<W, S>(mut writer: W, relations: &mut S, hash: Hash) -> Result<(), StoreError>
where
W: DbWriter + DirectWriter,
W: DirectWriter,
S: RelationsStore + ?Sized,
{
let children = relations.get_children(hash)?; // if the first entry was found, we expect all others as well, hence we unwrap below
Expand All @@ -49,7 +49,7 @@ where
/// (and writes will not accumulate if the entry gets out of the cache in between the calls)
pub fn delete_reachability_relations<W, S, U>(mut writer: W, relations: &mut S, reachability: &U, hash: Hash) -> BlockHashSet
where
W: DbWriter + DirectWriter,
W: DirectWriter,
S: RelationsStore + ?Sized,
U: ReachabilityService + ?Sized,
{
Expand Down

0 comments on commit b46f6a2

Please sign in to comment.