X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Foffers%2Foffer.rs;fp=lightning%2Fsrc%2Foffers%2Foffer.rs;h=62505d27b0649151bfad3b79527466f86513fecf;hb=562f472cc2a816862d3e8339f05c7cd4ed4c09ec;hp=405e2e278d8073eac345a801f88906422989f173;hpb=af76face12e924132596479f8b54849b14414f84;p=rust-lightning diff --git a/lightning/src/offers/offer.rs b/lightning/src/offers/offer.rs index 405e2e27..62505d27 100644 --- a/lightning/src/offers/offer.rs +++ b/lightning/src/offers/offer.rs @@ -536,15 +536,12 @@ pub enum Amount { /// An amount of currency specified using ISO 4712. Currency { /// The currency that the amount is denominated in. - iso4217_code: CurrencyCode, + iso4217_code: [u8; 3], /// The amount in the currency unit adjusted by the ISO 4712 exponent (e.g., USD cents). amount: u64, }, } -/// An ISO 4712 three-letter currency code (e.g., USD). -pub type CurrencyCode = [u8; 3]; - /// Quantity of items supported by an [`Offer`]. #[derive(Clone, Copy, Debug, PartialEq)] pub enum Quantity { @@ -573,7 +570,7 @@ impl Quantity { tlv_stream!(OfferTlvStream, OfferTlvStreamRef, 1..80, { (2, chains: (Vec, WithoutLength)), (4, metadata: (Vec, WithoutLength)), - (6, currency: CurrencyCode), + (6, currency: [u8; 3]), (8, amount: (u64, HighZeroBytesDroppedBigSize)), (10, description: (String, WithoutLength)), (12, features: (OfferFeatures, WithoutLength)),