Conversation
636735a to
97ea7de
Compare
| MaspTxRef::MaspSection(masp_tx_id) => { | ||
| transaction | ||
| .get_masp_section(&masp_tx_id) | ||
| .map(|bundle| bundle.clone().into_data().sapling_bundle().map(|bundle| bundle.shielded_spends.len() + bundle.shielded_outputs.len()).unwrap_or_default()).unwrap_or_default() as u64 |
There was a problem hiding this comment.
Here and down below it might be nice to also account for the length of the shielded_converts vector since conversions affect the gas cost too. But let me know, maybe this would make the indexer algorithm too overfitted on the details of masp txs
|
|
||
| let notes = masp_refs.clone().into_iter().map(|masp_ref| { | ||
| match masp_ref { | ||
| MaspTxRef::MaspSection(masp_tx_id) => { |
There was a problem hiding this comment.
I believe we should check if this specific masp ref belongs to this inner tx
There was a problem hiding this comment.
Yes so, we'd need to check if the inner tx we are currently analyzing is a successful masp tx and if so pop from the head of the masp_refs vector the next element and run the match expression here above. It's a bit unlucky cause the events don't carry the exact inner tx index of that masp data (it's not needed when constructing the local state of a shielded wallet) so we kind of have to do this manually in here. We should have the batch event somewhere here so that we can check the exit code of this inner tx. Understanding if it is a masp tx could be slightly more complex: we'd need to deserialize the tx data and see if it is a transfer, ibc transfer or neither. If none, then this is not a masp tx. If it is either a transfer or an ibc transfer we should check if it contains the pointer to the same MaspTxRef that we expect: if so we extract, otherwise we skip
|
Closing this in favor of #275 |
No description provided.