Modify BundleType to exclude the anchor & allow no bundle to be produced.#409
Modify BundleType to exclude the anchor & allow no bundle to be produced.#409
BundleType to exclude the anchor & allow no bundle to be produced.#409Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #409 +/- ##
==========================================
+ Coverage 80.98% 80.99% +0.01%
==========================================
Files 31 31
Lines 3139 3146 +7
==========================================
+ Hits 2542 2548 +6
- Misses 597 598 +1 ☔ View full report in Codecov by Sentry. |
…duced. This adds a flag to `BundleType` that, when set, requires a dummy-only bundle to be produced even if no spends or outputs are added to the builder, and when unset results in standard padding.
3523c70 to
3845686
Compare
35bfb15 to
1892573
Compare
| /// This anchor does not correspond to any valid anchor for a spend, so it | ||
| /// may only be used for coinbase bundles or in circumstances where Orchard | ||
| /// functionality is not active. |
There was a problem hiding this comment.
It is entirely valid to use the empty tree in regular bundles. Doing so is equivalent to setting enable_spends = false - it proves publicly that the Orchard bundle spends no notes (but may still have real outputs). I think this comment is fine however because callers should reach for enable_spends in this case, rather than the empty anchor.
| let mut builder = Builder::new(BundleType::Transactional(Flags::SPENDS_DISABLED, anchor)); | ||
| let mut builder = Builder::new( | ||
| BundleType::Transactional { | ||
| flags: Flags::SPENDS_DISABLED, |
There was a problem hiding this comment.
Nit: this publicly announces that spends are disabled, which in a real shielding bundle may be highly undesirable. This doesn't matter in a test, but we should avoid doing this in examples that downstream crate users are likely to look at for reference.
No description provided.