Open grarco opened 4 months ago
Possible improvement of the way we access the section commitments of an inner tx
enum TxCommitmentRef { Id(TxCommitments), Hash(Hash), Index(usize), } impl TxCommitmentRef { fn get_commitments( &self, batch: impl IntoIterator<Item = &TxCommitments>, ) -> Option<&TxCommitments> { match self { Self::Id(commitments) => { // FIXME: check that `commitments` is present in `batch`? commitments } Self::Hash(commitments_hash) => batch.into_iter().find_map(|commitments| { (hash(commitments) == commitments_hash).then_some(commitments) }), Self::Index(index) => batch.into_iter().nth(index), } } }
_Originally posted by @sug0 in https://github.com/anoma/namada/pull/3103#discussion_r1589154606_
Depends on #3103
@grarco Is this still applicable?
Yes it is
Possible improvement of the way we access the section commitments of an inner tx
_Originally posted by @sug0 in https://github.com/anoma/namada/pull/3103#discussion_r1589154606_