/// Sets the [`Offer::amount`].
///
/// Successive calls to this method will override the previous setting.
- fn amount(mut self, amount: Amount) -> Self {
+ pub(super) fn amount(mut self, amount: Amount) -> Self {
self.offer.amount = Some(amount);
self
}
self.offer.features = features;
self
}
+
+ pub(super) fn build_unchecked(self) -> Offer {
+ let mut bytes = Vec::new();
+ self.offer.write(&mut bytes).unwrap();
+
+ Offer { bytes, contents: self.offer }
+ }
}
/// An `Offer` is a potentially long-lived proposal for payment of a good or service.
}
#[cfg(test)]
- fn as_tlv_stream(&self) -> OfferTlvStreamRef {
+ pub(super) fn as_tlv_stream(&self) -> OfferTlvStreamRef {
self.contents.as_tlv_stream()
}
}