-
Notifications
You must be signed in to change notification settings - Fork 420
Closed
Description
It does not make sense for a BlockId to have a default. We use the Default to semantically mean a null block. e.g.
self.indexed_graph
.graph()
.filter_chain_unspents(
&self.chain,
self.chain.tip().map(|cp| cp.block_id()).unwrap_or_default(),
self.indexed_graph.index.outpoints().iter().cloned(),
)
I think these should just take an Option for the tip since that's the rusty way of communicating null. When it's None it should just be assumed that nothing is in the chain.
Maybe the tip should take an argument that is Option<B> where B: Into<BlockId> to avoid the map.
On a related note ChainOracle has get_chain_tip despite this not being used anywhere. I'd say we should remove it. Perhaps we will want this later but we can just make a new trait for that like GetChainTip.
Metadata
Metadata
Assignees
Labels
new featureNew feature or requestNew feature or request
Type
Projects
Status
Done