@@ -6,6 +6,7 @@ use contracts::DCDArguments;
66use simplicityhl:: elements:: OutPoint ;
77use sqlx:: { Connection , Sqlite , SqlitePool , migrate:: MigrateDatabase } ;
88use std:: path:: PathBuf ;
9+ use tracing:: instrument;
910
1011const CARGO_MANIFEST_DIR : & str = env ! ( "CARGO_MANIFEST_DIR" ) ;
1112
@@ -76,7 +77,10 @@ impl SqliteRepo {
7677
7778#[ async_trait]
7879impl CoinSelectionStorage for SqliteRepo {
80+ #[ instrument( level = "debug" , skip_all, err) ]
7981 async fn mark_outpoints_spent ( & self , outpoints : & [ OutPoint ] ) -> Result < ( ) > {
82+ tracing:: debug!( "Input params, outpoints: {outpoints:?}" ) ;
83+
8084 // mark given outpoints as spent in a single transaction
8185 let mut tx = self . pool . begin ( ) . await ?;
8286 for op in outpoints {
@@ -96,7 +100,10 @@ impl CoinSelectionStorage for SqliteRepo {
96100 Ok ( ( ) )
97101 }
98102
103+ #[ instrument( level = "debug" , skip_all, err) ]
99104 async fn add_outpoint ( & self , info : OutPointInfo ) -> Result < ( ) > {
105+ tracing:: debug!( "Input params, info: {info:?}" ) ;
106+
100107 sqlx:: query (
101108 r#"
102109 INSERT INTO outpoints (tx_id, vout, owner_script_pubkey, asset_id, spent)
@@ -118,7 +125,10 @@ impl CoinSelectionStorage for SqliteRepo {
118125 Ok ( ( ) )
119126 }
120127
128+ #[ instrument( level = "debug" , skip_all, err) ]
121129 async fn get_token_outpoints ( & self , filter : GetTokenFilter ) -> Result < Vec < OutPointInfoRaw > > {
130+ tracing:: debug!( "Input params, filter: {filter:?}" ) ;
131+
122132 let base = "SELECT id, tx_id, vout, owner_script_pubkey, asset_id, spent FROM outpoints" ;
123133 let where_clause = filter. get_sql_filter ( ) ;
124134 let query = format ! ( "{base}{where_clause}" ) ;
@@ -158,7 +168,9 @@ impl CoinSelectionStorage for SqliteRepo {
158168
159169#[ async_trait]
160170impl DcdParamsStorage for SqliteRepo {
171+ #[ instrument( level = "debug" , skip_all, err) ]
161172 async fn add_dcd_params ( & self , taproot_pubkey_gen : & str , dcd_args : & DCDArguments ) -> Result < ( ) > {
173+ tracing:: debug!( "Input params, taproot: {taproot_pubkey_gen}, dcd_args: {dcd_args:?}" ) ;
162174 let serialized = bincode:: encode_to_vec ( dcd_args, bincode:: config:: standard ( ) ) ?;
163175
164176 sqlx:: query (
@@ -174,7 +186,9 @@ impl DcdParamsStorage for SqliteRepo {
174186 Ok ( ( ) )
175187 }
176188
189+ #[ instrument( level = "debug" , skip_all, err) ]
177190 async fn get_dcd_params ( & self , taproot_pubkey_gen : & str ) -> Result < Option < DCDArguments > > {
191+ tracing:: debug!( "Input params, taproot: {taproot_pubkey_gen}" ) ;
178192 let row = sqlx:: query_as :: < _ , ( Vec < u8 > , ) > ( "SELECT dcd_args_blob FROM dcd_params WHERE taproot_pubkey_gen = ?" )
179193 . bind ( taproot_pubkey_gen)
180194 . fetch_optional ( & self . pool )
@@ -192,6 +206,7 @@ impl DcdParamsStorage for SqliteRepo {
192206
193207#[ async_trait]
194208impl EntropyStorage for SqliteRepo {
209+ #[ instrument( level = "debug" , skip_all, err) ]
195210 async fn add_dcd_contract_token_entropies (
196211 & self ,
197212 taproot_pubkey_gen : & str ,
@@ -212,6 +227,7 @@ impl EntropyStorage for SqliteRepo {
212227 Ok ( ( ) )
213228 }
214229
230+ #[ instrument( level = "debug" , skip_all, err) ]
215231 async fn get_dcd_contract_token_entropies (
216232 & self ,
217233 taproot_pubkey_gen : & str ,
0 commit comments