diff --git a/rgb20/src/asset.rs b/rgb20/src/asset.rs index 86218ce7e063d..77ed38d3ab828 100644 --- a/rgb20/src/asset.rs +++ b/rgb20/src/asset.rs @@ -228,7 +228,7 @@ impl Asset { Clone, Copy, Getters, PartialEq, Debug, Display, StrictEncode, StrictDecode, )] #[strict_encoding_crate(lnpbp::strict_encoding)] -#[display("{value}@{node_id}#{index}={outpoint}")] +#[display("{confidential_amount}@{node_id}/{index}={outpoint}")] pub struct Allocation { /// Unique primary key is `node_id` + `index` node_id: NodeId, @@ -241,9 +241,9 @@ pub struct Allocation { #[cfg_attr(feature = "serde", serde(with = "As::"))] outpoint: bitcoin::OutPoint, - /// Revealed value consisting of an explicit atomic amount and Pedesen - /// commitment blinding factor - value: value::Revealed, + /// Revealed confidential amount consisting of an explicit atomic amount + /// and Pedesen commitment blinding factor + confidential_amount: value::Revealed, } impl Allocation { @@ -258,7 +258,7 @@ impl Allocation { node_id, index, outpoint, - value, + confidential_amount: value, } } } @@ -415,7 +415,7 @@ impl Asset { node_id, index, outpoint, - value, + confidential_amount: value, }; if !self.known_allocations.contains(&new_allocation) { self.known_allocations.push(new_allocation); @@ -436,7 +436,7 @@ impl Asset { node_id, index, outpoint, - value, + confidential_amount: value, }; if let Some(index) = self .known_allocations @@ -539,7 +539,7 @@ impl TryFrom for Asset { node_id, index: index as u16, outpoint: outpoint_reveal.into(), - value: assigned_state, + confidential_amount: assigned_state, }) } }); diff --git a/rgb20/src/processor.rs b/rgb20/src/processor.rs index e0e24147c7b98..a36c6d305bfc9 100644 --- a/rgb20/src/processor.rs +++ b/rgb20/src/processor.rs @@ -153,7 +153,7 @@ pub fn transfer( // Computing sum of inputs let total_inputs = input_allocations .iter() - .fold(0u64, |acc, alloc| acc + alloc.value().value); + .fold(0u64, |acc, alloc| acc + alloc.confidential_amount().value); let metadata = type_map! {}; let mut total_outputs = 0; @@ -186,7 +186,7 @@ pub fn transfer( let input_amounts = input_allocations .iter() - .map(|alloc| alloc.value().clone()) + .map(|alloc| alloc.confidential_amount().clone()) .collect(); let assignments = type_map! { OwnedRightsType::Assets =>