Skip to content

Commit

Permalink
feat: add reference_inputs to TransactionRecord (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
yHSJ authored Dec 17, 2024
1 parent 96c0865 commit d514f44
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions assets/denopkgs/v2AlphaOuraUtils/ouraTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export type TransactionRecord = {
outputs: TxOutputRecord[] | null;
collateral_inputs: TxInputRecord[] | null;
collateral_output: TxOutputRecord | null;
reference_inputs: TxInputRecord[] | null;
mint: MintRecord[] | null;
vkey_witnesses: VKeyWitnessRecord[] | null;
native_witnesses: NativeWitnessRecord[] | null;
Expand Down
11 changes: 11 additions & 0 deletions src/filters/legacy_v1/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,17 @@ impl EventWriter<'_> {
.map(|x| self.to_withdrawal_record(*x))
.collect::<Vec<_>>()
.into();

record.reference_inputs = if tx.reference_inputs().is_empty() {
None
} else {
Some(
tx.reference_inputs()
.iter()
.map(TxInputRecord::from)
.collect(),
)
};
}

record
Expand Down
1 change: 1 addition & 0 deletions src/framework/legacy_v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ pub struct TransactionRecord {
pub outputs: Option<Vec<TxOutputRecord>>,
pub collateral_inputs: Option<Vec<TxInputRecord>>,
pub collateral_output: Option<TxOutputRecord>,
pub reference_inputs: Option<Vec<TxInputRecord>>,
pub mint: Option<Vec<MintRecord>>,
pub vkey_witnesses: Option<Vec<VKeyWitnessRecord>>,
pub native_witnesses: Option<Vec<NativeWitnessRecord>>,
Expand Down

0 comments on commit d514f44

Please sign in to comment.