Skip to content

Commit 690ce69

Browse files
committed
remove getset from sync state
1 parent 5b83fbd commit 690ce69

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

zingo-sync/src/primitives.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,26 +222,32 @@ impl std::fmt::Display for SyncStatus {
222222
}
223223

224224
/// Output ID for a given pool type
225-
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, CopyGetters)]
226-
#[getset(get_copy = "pub")]
225+
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
227226
pub struct OutputId {
228227
/// ID of associated transaction
229228
txid: TxId,
230229
/// Index of output within the transactions bundle of the given pool type.
231-
// TODO: change to u16
232-
output_index: usize,
230+
output_index: u16,
233231
}
234232

235233
impl OutputId {
236234
/// Creates new OutputId from parts
237-
pub fn from_parts(txid: TxId, output_index: usize) -> Self {
235+
pub fn from_parts(txid: TxId, output_index: u16) -> Self {
238236
OutputId { txid, output_index }
239237
}
238+
239+
pub fn txid(&self) -> TxId {
240+
self.txid
241+
}
242+
243+
pub fn output_index(&self) -> u16 {
244+
self.output_index
245+
}
240246
}
241247

242248
impl From<&OutPoint> for OutputId {
243249
fn from(value: &OutPoint) -> Self {
244-
OutputId::from_parts(*value.txid(), value.n() as usize)
250+
OutputId::from_parts(*value.txid(), value.n() as u16)
245251
}
246252
}
247253

zingo-sync/src/scan/compact_blocks/runners.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ where
596596
output_index,
597597
value,
598598
}| {
599-
(OutputId::from_parts(txid, output_index), value)
599+
(OutputId::from_parts(txid, output_index as u16), value)
600600
},
601601
)
602602
.collect()

0 commit comments

Comments
 (0)