@@ -65,18 +65,18 @@ pub(crate) enum Maturity {
65
65
66
66
#[ allow( dead_code) ]
67
67
pub ( crate ) struct Wallet {
68
- wallet : PersistedWallet < DatabasePersister > ,
69
68
database : Arc < Database > ,
70
69
has_rune_index : bool ,
71
70
has_sat_index : bool ,
72
- rpc_url : Url ,
73
- utxos : BTreeMap < OutPoint , TxOut > ,
74
71
ord_client : reqwest:: blocking:: Client ,
75
- inscription_info : BTreeMap < InscriptionId , api:: Inscription > ,
76
- output_info : BTreeMap < OutPoint , api:: Output > ,
77
- inscriptions : BTreeMap < SatPoint , Vec < InscriptionId > > ,
78
- locked_utxos : BTreeMap < OutPoint , TxOut > ,
72
+ rpc_url : Url ,
79
73
settings : Settings ,
74
+ wallet : PersistedWallet < DatabasePersister > ,
75
+ // inscription_info: BTreeMap<InscriptionId, api::Inscription>,
76
+ // inscriptions: BTreeMap<SatPoint, Vec<InscriptionId>>,
77
+ // locked_utxos: BTreeMap<OutPoint, TxOut>,
78
+ // output_info: BTreeMap<OutPoint, api::Output>,
79
+ // utxos: BTreeMap<OutPoint, TxOut>,
80
80
}
81
81
82
82
#[ allow( dead_code) ]
@@ -88,7 +88,7 @@ impl Wallet {
88
88
seed : [ u8 ; 64 ] ,
89
89
timestamp : bitcoincore_rpc:: json:: Timestamp ,
90
90
) -> Result {
91
- let database = Arc :: new ( create_database ( & name, settings) ?) ;
91
+ let database = create_database ( & name, settings) ?;
92
92
93
93
let mut wtx = database. begin_write ( ) ?;
94
94
@@ -146,7 +146,7 @@ impl Wallet {
146
146
) ;
147
147
148
148
let mut output_sat_ranges = Vec :: new ( ) ;
149
- for ( output, info) in self . output_info . iter ( ) {
149
+ for ( output, info) in self . output_info ( ) . iter ( ) {
150
150
if let Some ( sat_ranges) = & info. sat_ranges {
151
151
output_sat_ranges. push ( ( * output, sat_ranges. clone ( ) ) ) ;
152
152
} else {
@@ -163,7 +163,7 @@ impl Wallet {
163
163
"ord index must be built with `--index-sats` to see sat ranges"
164
164
) ;
165
165
166
- if let Some ( info) = self . output_info . get ( output) {
166
+ if let Some ( info) = self . output_info ( ) . get ( output) {
167
167
if let Some ( sat_ranges) = & info. sat_ranges {
168
168
Ok ( sat_ranges. clone ( ) )
169
169
} else {
@@ -180,7 +180,7 @@ impl Wallet {
180
180
"ord index must be built with `--index-sats` to use `--sat`"
181
181
) ;
182
182
183
- for ( outpoint, info) in self . output_info . iter ( ) {
183
+ for ( outpoint, info) in self . output_info ( ) . iter ( ) {
184
184
if let Some ( sat_ranges) = & info. sat_ranges {
185
185
let mut offset = 0 ;
186
186
for ( start, end) in sat_ranges {
@@ -207,11 +207,11 @@ impl Wallet {
207
207
}
208
208
209
209
pub ( crate ) fn utxos ( & self ) -> & BTreeMap < OutPoint , TxOut > {
210
- & self . utxos
210
+ todo ! ( )
211
211
}
212
212
213
213
pub ( crate ) fn locked_utxos ( & self ) -> & BTreeMap < OutPoint , TxOut > {
214
- & self . locked_utxos
214
+ todo ! ( )
215
215
}
216
216
217
217
pub ( crate ) fn lock_non_cardinal_outputs ( & self ) -> Result {
@@ -244,11 +244,15 @@ impl Wallet {
244
244
}
245
245
246
246
pub ( crate ) fn inscriptions ( & self ) -> & BTreeMap < SatPoint , Vec < InscriptionId > > {
247
- & self . inscriptions
247
+ todo ! ( ) ;
248
248
}
249
249
250
250
pub ( crate ) fn inscription_info ( & self ) -> BTreeMap < InscriptionId , api:: Inscription > {
251
- self . inscription_info . clone ( )
251
+ todo ! ( ) ;
252
+ }
253
+
254
+ pub ( crate ) fn output_info ( & self ) -> BTreeMap < OutPoint , api:: Output > {
255
+ todo ! ( ) ;
252
256
}
253
257
254
258
pub ( crate ) fn get_inscription (
@@ -291,7 +295,7 @@ impl Wallet {
291
295
) -> Result < Option < Vec < InscriptionId > > > {
292
296
Ok (
293
297
self
294
- . output_info
298
+ . output_info ( )
295
299
. get ( output)
296
300
. ok_or ( anyhow ! ( "output not found in wallet" ) ) ?
297
301
. inscriptions
@@ -307,13 +311,13 @@ impl Wallet {
307
311
}
308
312
309
313
let satpoint = self
310
- . inscription_info
314
+ . inscription_info ( )
311
315
. get ( parent_id)
312
316
. ok_or_else ( || anyhow ! ( "parent {parent_id} not in wallet" ) ) ?
313
317
. satpoint ;
314
318
315
319
let tx_out = self
316
- . utxos
320
+ . utxos ( )
317
321
. get ( & satpoint. outpoint )
318
322
. ok_or_else ( || anyhow ! ( "parent {parent_id} not in wallet" ) ) ?
319
323
. clone ( ) ;
@@ -331,7 +335,7 @@ impl Wallet {
331
335
332
336
pub ( crate ) fn get_runic_outputs ( & self ) -> Result < Option < BTreeSet < OutPoint > > > {
333
337
let mut runic_outputs = BTreeSet :: new ( ) ;
334
- for ( output, info) in & self . output_info {
338
+ for ( output, info) in & self . output_info ( ) {
335
339
let Some ( runes) = & info. runes else {
336
340
return Ok ( None ) ;
337
341
} ;
@@ -350,7 +354,7 @@ impl Wallet {
350
354
) -> Result < Option < BTreeMap < SpacedRune , Pile > > > {
351
355
Ok (
352
356
self
353
- . output_info
357
+ . output_info ( )
354
358
. get ( output)
355
359
. ok_or ( anyhow ! ( "output not found in wallet" ) ) ?
356
360
. runes
0 commit comments