@@ -122,9 +122,9 @@ impl TransactionBuilder {
122122 /// Build the DbcTransaction by signing the inputs,
123123 /// and generating the blinded outputs. Return a DbcBuilder.
124124 pub fn build ( self , reason : Hash , rng : impl RngCore + CryptoRng ) -> Result < DbcBuilder > {
125- let ( dst_tx , revealed_outputs) = self . revealed_tx . sign ( rng) ?;
125+ let ( spent_tx , revealed_outputs) = self . revealed_tx . sign ( rng) ?;
126126
127- let signed_spends: BTreeSet < _ > = dst_tx
127+ let signed_spends: BTreeSet < _ > = spent_tx
128128 . inputs
129129 . iter ( )
130130 . flat_map ( |input| {
@@ -135,10 +135,10 @@ impl TransactionBuilder {
135135 . map ( |i| {
136136 let spend = crate :: Spend {
137137 dbc_id : input. dbc_id ( ) ,
138- dst_tx : dst_tx . clone ( ) ,
138+ spent_tx : spent_tx . clone ( ) ,
139139 reason,
140140 blinded_amount : input. blinded_amount ,
141- src_tx_hash : i. input_src_tx . hash ( ) ,
141+ dbc_creation_tx_hash : i. input_src_tx . hash ( ) ,
142142 } ;
143143 let derived_key_sig = i. input . derived_key . sign ( & spend. to_bytes ( ) ) ;
144144 SignedSpend {
@@ -150,7 +150,7 @@ impl TransactionBuilder {
150150 . collect ( ) ;
151151
152152 Ok ( DbcBuilder :: new (
153- dst_tx ,
153+ spent_tx ,
154154 revealed_outputs,
155155 self . output_id_sources ,
156156 self . revealed_tx ,
@@ -163,7 +163,7 @@ impl TransactionBuilder {
163163#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
164164#[ derive( Debug , Clone ) ]
165165pub struct DbcBuilder {
166- pub dst_tx : DbcTransaction ,
166+ pub spent_tx : DbcTransaction ,
167167 pub revealed_outputs : Vec < RevealedOutput > ,
168168 pub output_id_sources : OutputIdSources ,
169169 pub revealed_tx : RevealedTx ,
@@ -173,14 +173,14 @@ pub struct DbcBuilder {
173173impl DbcBuilder {
174174 /// Create a new DbcBuilder.
175175 pub fn new (
176- dst_tx : DbcTransaction ,
176+ spent_tx : DbcTransaction ,
177177 revealed_outputs : Vec < RevealedOutput > ,
178178 output_id_sources : OutputIdSources ,
179179 revealed_tx : RevealedTx ,
180180 signed_spends : BTreeSet < SignedSpend > ,
181181 ) -> Self {
182182 Self {
183- dst_tx ,
183+ spent_tx ,
184184 revealed_outputs,
185185 output_id_sources,
186186 revealed_tx,
@@ -189,7 +189,7 @@ impl DbcBuilder {
189189 }
190190
191191 /// Return the signed spends. They each already contain the
192- /// dst_tx , so the inclusion of it in the result is just for convenience.
192+ /// spent_tx , so the inclusion of it in the result is just for convenience.
193193 pub fn signed_spends ( & self ) -> Vec < & SignedSpend > {
194194 self . signed_spends . iter ( ) . collect ( )
195195 }
@@ -201,7 +201,7 @@ impl DbcBuilder {
201201 pub fn build ( self ) -> Result < Vec < ( Dbc , RevealedAmount ) > > {
202202 // Verify the tx, along with signed spends.
203203 // Note that we do this just once for entire tx, not once per output Dbc.
204- TransactionVerifier :: verify ( & self . dst_tx , & self . signed_spends ) ?;
204+ TransactionVerifier :: verify ( & self . spent_tx , & self . signed_spends ) ?;
205205
206206 // Build output Dbcs.
207207 self . build_output_dbcs ( )
@@ -223,7 +223,7 @@ impl DbcBuilder {
223223 . collect ( ) ;
224224
225225 let dbc_id_list: Vec < & DbcIdSource > = self
226- . dst_tx
226+ . spent_tx
227227 . outputs
228228 . iter ( )
229229 . map ( |output| {
@@ -235,7 +235,7 @@ impl DbcBuilder {
235235
236236 // Form the final output DBCs
237237 let output_dbcs: Vec < ( Dbc , RevealedAmount ) > = self
238- . dst_tx
238+ . spent_tx
239239 . outputs
240240 . iter ( )
241241 . zip ( dbc_id_list)
@@ -254,7 +254,7 @@ impl DbcBuilder {
254254 ) ) ;
255255 let dbc = Dbc {
256256 id : dbc_id_src. dbc_id ( ) ,
257- src_tx : self . dst_tx . clone ( ) ,
257+ src_tx : self . spent_tx . clone ( ) ,
258258 ciphers,
259259 signed_spends : self . signed_spends . clone ( ) ,
260260 } ;
0 commit comments