Skip to content

Commit bf299a5

Browse files
authored
Merge pull request #188 from SiaFoundation/christopher/fix-v2-output-sources
Fix v2 output sources
2 parents 7dcc543 + 01941c9 commit bf299a5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

explorer/update.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ func applyChainUpdate(tx UpdateTx, cau chain.ApplyUpdate) error {
9090
}
9191
}
9292

93+
for _, txn := range cau.Block.V2Transactions() {
94+
txnID := txn.ID()
95+
for i := range txn.SiacoinOutputs {
96+
sources[txn.SiacoinOutputID(txnID, i)] = SourceTransaction
97+
}
98+
}
99+
93100
for _, diff := range cau.FileContractElementDiffs() {
94101
if diff.Resolved {
95102
fcID := diff.FileContractElement.ID

internal/testutil/check.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ func CheckV2Transaction(t *testing.T, expectTxn types.V2Transaction, gotTxn expl
159159

160160
Equal(t, "address", expected.Address, got.Address)
161161
Equal(t, "value", expected.Value, got.Value)
162+
Equal(t, "source", explorer.SourceTransaction, gotTxn.SiacoinOutputs[i].Source)
162163
}
163164

164165
Equal(t, "siafund inputs", len(expectTxn.SiafundInputs), len(gotTxn.SiafundInputs))

0 commit comments

Comments
 (0)