Closed romanzac closed 1 week ago
I have a question about ParentMissing(Id) error. It is not returned from:
pub fn get(&self, id: &Id) -> Option<&Branch<Id>> {
self.branches.get(id)
}
Is this lose relationship what we want ? If not, I will reimplement to return Result.
OrphanMissing(Id) error is not used yet, so I left it alone for now.
I have a question about ParentMissing(Id) error. It is not returned from:
pub fn get(&self, id: &Id) -> Option<&Branch<Id>> { self.branches.get(id) }
Is this lose relationship what we want ? If not, I will reimplement to return Result.
Thank you! I think we can change this function to return ParentMissing, but I'd like to wait for @zeegomo's review first.
I have a question about ParentMissing(Id) error. It is not returned from:
pub fn get(&self, id: &Id) -> Option<&Branch<Id>> { self.branches.get(id) }
Is this lose relationship what we want ? If not, I will reimplement to return Result.
Branches
is a collection of all the branches known to the node. The get
method is used to request a branch using its last block as id, I think an Option
is the natural return type for a search in a collection.
Anyway, ParentMissing
would not be the correct error, as we're missing the block in id,
not its parent. How this method is used in downstream users and the errors returned there should not propagate here
Batch of tests for Cryptarchia to improve coverage