Skip to content

Commit

Permalink
Merge pull request #134 from SiaFoundation/dependabot/go_modules/all-…
Browse files Browse the repository at this point in the history
…dependencies-a9ab562ff7

Bump the all-dependencies group with 2 updates
  • Loading branch information
n8maninger authored Nov 6, 2024
2 parents 148f552 + dcba785 commit 408dd43
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 55 deletions.
26 changes: 13 additions & 13 deletions explorer/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,20 @@ func AppliedEvents(cs consensus.State, b types.Block, cu ChainUpdate) []Event {
fces := make(map[types.FileContractID]types.FileContractElement)
v2fces := make(map[types.FileContractID]types.V2FileContractElement)
cu.ForEachSiacoinElement(func(sce types.SiacoinElement, created, spent bool) {
sce.MerkleProof = nil
sces[types.SiacoinOutputID(sce.ID)] = sce
sce.StateElement.MerkleProof = nil
sces[sce.ID] = sce
})
cu.ForEachSiafundElement(func(sfe types.SiafundElement, created, spent bool) {
sfe.MerkleProof = nil
sfes[types.SiafundOutputID(sfe.ID)] = sfe
sfe.StateElement.MerkleProof = nil
sfes[sfe.ID] = sfe
})
cu.ForEachFileContractElement(func(fce types.FileContractElement, created bool, rev *types.FileContractElement, resolved, valid bool) {
fce.MerkleProof = nil
fces[types.FileContractID(fce.ID)] = fce
fce.StateElement.MerkleProof = nil
fces[fce.ID] = fce
})
cu.ForEachV2FileContractElement(func(fce types.V2FileContractElement, created bool, rev *types.V2FileContractElement, res types.V2FileContractResolutionType) {
fce.MerkleProof = nil
v2fces[types.FileContractID(fce.ID)] = fce
fce.StateElement.MerkleProof = nil
v2fces[fce.ID] = fce
})

relevantTxn := func(txn types.Transaction) (addrs []types.Address) {
Expand Down Expand Up @@ -219,9 +219,9 @@ func AppliedEvents(cs consensus.State, b types.Block, cu ChainUpdate) []Event {

var e EventV2Transaction
for _, a := range txn.Attestations {
var ha chain.HostAnnouncement
if ha.FromAttestation(a) {
e.HostAnnouncements = append(e.HostAnnouncements, ha)
var ha chain.V2HostAnnouncement
if ha.FromAttestation(a) == nil {
// TODO: handle attestation
}
}
addEvent(types.Hash256(txn.ID()), cs.Index.Height, &e, relevant) // transaction maturity height is the current block height
Expand All @@ -235,7 +235,7 @@ func AppliedEvents(cs consensus.State, b types.Block, cu ChainUpdate) []Event {

if valid {
for i := range fce.FileContract.ValidProofOutputs {
outputID := types.FileContractID(fce.ID).ValidOutputID(i)
outputID := fce.ID.ValidOutputID(i)
addEvent(types.Hash256(outputID), cs.MaturityHeight(), &EventContractPayout{
FileContract: fce,
SiacoinOutput: sces[outputID],
Expand All @@ -244,7 +244,7 @@ func AppliedEvents(cs consensus.State, b types.Block, cu ChainUpdate) []Event {
}
} else {
for i := range fce.FileContract.MissedProofOutputs {
outputID := types.FileContractID(fce.ID).MissedOutputID(i)
outputID := fce.ID.MissedOutputID(i)
addEvent(types.Hash256(outputID), cs.MaturityHeight(), &EventContractPayout{
FileContract: fce,
SiacoinOutput: sces[outputID],
Expand Down
10 changes: 5 additions & 5 deletions explorer/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@ func applyChainUpdate(tx UpdateTx, cau chain.ApplyUpdate) error {
if created && spent {
ephemeralSiacoinElements = append(ephemeralSiacoinElements, SiacoinOutput{
SiacoinElement: se,
Source: sources[types.SiacoinOutputID(se.StateElement.ID)],
Source: sources[se.ID],
})
return
}

if spent {
spentSiacoinElements = append(spentSiacoinElements, SiacoinOutput{
SiacoinElement: se,
Source: sources[types.SiacoinOutputID(se.StateElement.ID)],
Source: sources[se.ID],
})
} else {
newSiacoinElements = append(newSiacoinElements, SiacoinOutput{
SiacoinElement: se,
Source: sources[types.SiacoinOutputID(se.StateElement.ID)],
Source: sources[se.ID],
})
}
})
Expand All @@ -126,7 +126,7 @@ func applyChainUpdate(tx UpdateTx, cau chain.ApplyUpdate) error {

fceMap := make(map[types.FileContractID]FileContractUpdate)
cau.ForEachFileContractElement(func(fce types.FileContractElement, created bool, rev *types.FileContractElement, resolved, valid bool) {
fceMap[types.FileContractID(fce.ID)] = FileContractUpdate{
fceMap[fce.ID] = FileContractUpdate{
FileContractElement: fce,
Revision: rev,
Resolved: resolved,
Expand Down Expand Up @@ -244,7 +244,7 @@ func revertChainUpdate(tx UpdateTx, cru chain.RevertUpdate, revertedIndex types.

fceMap := make(map[types.FileContractID]FileContractUpdate)
cru.ForEachFileContractElement(func(fce types.FileContractElement, created bool, rev *types.FileContractElement, resolved, valid bool) {
fceMap[types.FileContractID(fce.ID)] = FileContractUpdate{
fceMap[fce.ID] = FileContractUpdate{
FileContractElement: fce,
Revision: rev,
Resolved: resolved,
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ go 1.23.1
toolchain go1.23.2

require (
github.com/ip2location/ip2location-go v8.3.0+incompatible
github.com/mattn/go-sqlite3 v1.14.24
go.sia.tech/core v0.5.0
go.sia.tech/coreutils v0.5.0
go.sia.tech/core v0.6.1
go.sia.tech/coreutils v0.6.0
go.sia.tech/jape v0.12.1
go.uber.org/zap v1.27.0
gopkg.in/yaml.v3 v3.0.1
Expand All @@ -16,7 +17,6 @@ require (
)

require (
github.com/ip2location/ip2location-go v8.3.0+incompatible // indirect
github.com/julienschmidt/httprouter v1.3.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gt
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0=
go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I=
go.sia.tech/core v0.5.0 h1:feLC7DSCF+PhU157s/94106hFKyiGrGQ9HC3/dF/l7E=
go.sia.tech/core v0.5.0/go.mod h1:P3C1BWa/7J4XgdzWuaYHBvLo2RzZ0UBaJM4TG1GWB2g=
go.sia.tech/coreutils v0.5.0 h1:/xKxdw83iZy0jjLzI2NGHyG4azyjK5DJscxpkr6nIGQ=
go.sia.tech/coreutils v0.5.0/go.mod h1:VYM4FcmlhVrpDGvglLHjRW+gitoaxPNLvp5mL2quilo=
go.sia.tech/core v0.6.1 h1:eaExM2E2eNr43su2XDkY5J24E3F54YGS7hcC3WtVjVk=
go.sia.tech/core v0.6.1/go.mod h1:P3C1BWa/7J4XgdzWuaYHBvLo2RzZ0UBaJM4TG1GWB2g=
go.sia.tech/coreutils v0.6.0 h1:r0IZt+aVdGG2uIHl7OtaWRYdVx4NQ7ezRoSGa0Ej8GY=
go.sia.tech/coreutils v0.6.0/go.mod h1:XlsnogeYU/Tdjzp/HUNAj5T7tZCdmeBHIBjymbPC+uQ=
go.sia.tech/jape v0.12.1 h1:xr+o9V8FO8ScRqbSaqYf9bjj1UJ2eipZuNcI1nYousU=
go.sia.tech/jape v0.12.1/go.mod h1:wU+h6Wh5olDjkPXjF0tbZ1GDgoZ6VTi4naFw91yyWC4=
go.sia.tech/mux v1.3.0 h1:hgR34IEkqvfBKUJkAzGi31OADeW2y7D6Bmy/Jcbop9c=
Expand Down
10 changes: 5 additions & 5 deletions persist/sqlite/addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ func scanEvent(tx *txn, s scanner) (ev explorer.Event, eventID int64, err error)
FROM contract_payout_events ev
JOIN siacoin_elements sce ON ev.output_id = sce.id
JOIN file_contract_elements fce ON ev.contract_id = fce.id
WHERE ev.event_id = ?`, eventID).Scan(decode(&m.SiacoinOutput.StateElement.ID), decode(&m.SiacoinOutput.StateElement.LeafIndex), &m.SiacoinOutput.MaturityHeight, decode(&m.SiacoinOutput.SiacoinOutput.Address), decode(&m.SiacoinOutput.SiacoinOutput.Value), decode(&m.FileContract.StateElement.ID), decode(&m.FileContract.StateElement.LeafIndex), decode(&m.FileContract.FileContract.Filesize), decode(&m.FileContract.FileContract.FileMerkleRoot), decode(&m.FileContract.FileContract.WindowStart), decode(&m.FileContract.FileContract.WindowEnd), decode(&m.FileContract.FileContract.Payout), decode(&m.FileContract.FileContract.UnlockHash), decode(&m.FileContract.FileContract.RevisionNumber), &m.Missed)
WHERE ev.event_id = ?`, eventID).Scan(decode(&m.SiacoinOutput.ID), decode(&m.SiacoinOutput.StateElement.LeafIndex), &m.SiacoinOutput.MaturityHeight, decode(&m.SiacoinOutput.SiacoinOutput.Address), decode(&m.SiacoinOutput.SiacoinOutput.Value), decode(&m.FileContract.ID), decode(&m.FileContract.StateElement.LeafIndex), decode(&m.FileContract.FileContract.Filesize), decode(&m.FileContract.FileContract.FileMerkleRoot), decode(&m.FileContract.FileContract.WindowStart), decode(&m.FileContract.FileContract.WindowEnd), decode(&m.FileContract.FileContract.Payout), decode(&m.FileContract.FileContract.UnlockHash), decode(&m.FileContract.FileContract.RevisionNumber), &m.Missed)
ev.Data = &m
case explorer.EventTypeMinerPayout:
var m explorer.EventMinerPayout
err = tx.QueryRow(`SELECT sc.output_id, sc.leaf_index, sc.maturity_height, sc.address, sc.value
FROM siacoin_elements sc
INNER JOIN miner_payout_events ev ON (ev.output_id = sc.id)
WHERE ev.event_id = ?`, eventID).Scan(decode(&m.SiacoinOutput.StateElement.ID), decode(&m.SiacoinOutput.StateElement.LeafIndex), decode(&m.SiacoinOutput.MaturityHeight), decode(&m.SiacoinOutput.SiacoinOutput.Address), decode(&m.SiacoinOutput.SiacoinOutput.Value))
WHERE ev.event_id = ?`, eventID).Scan(decode(&m.SiacoinOutput.ID), decode(&m.SiacoinOutput.StateElement.LeafIndex), decode(&m.SiacoinOutput.MaturityHeight), decode(&m.SiacoinOutput.SiacoinOutput.Address), decode(&m.SiacoinOutput.SiacoinOutput.Value))
if err != nil {
return explorer.Event{}, 0, fmt.Errorf("failed to fetch miner payout event data: %w", err)
}
Expand All @@ -86,7 +86,7 @@ WHERE ev.event_id = ?`, eventID).Scan(decode(&m.SiacoinOutput.StateElement.ID),
err = tx.QueryRow(`SELECT sc.output_id, sc.leaf_index, sc.maturity_height, sc.address, sc.value
FROM siacoin_elements sc
INNER JOIN foundation_subsidy_events ev ON (ev.output_id = sc.id)
WHERE ev.event_id = ?`, eventID).Scan(decode(&m.SiacoinOutput.StateElement.ID), decode(&m.SiacoinOutput.StateElement.LeafIndex), decode(&m.SiacoinOutput.MaturityHeight), decode(&m.SiacoinOutput.SiacoinOutput.Address), decode(&m.SiacoinOutput.SiacoinOutput.Value))
WHERE ev.event_id = ?`, eventID).Scan(decode(&m.SiacoinOutput.ID), decode(&m.SiacoinOutput.StateElement.LeafIndex), decode(&m.SiacoinOutput.MaturityHeight), decode(&m.SiacoinOutput.SiacoinOutput.Address), decode(&m.SiacoinOutput.SiacoinOutput.Value))
ev.Data = &m
default:
return explorer.Event{}, 0, fmt.Errorf("unknown event type: %s", eventType)
Expand Down Expand Up @@ -180,7 +180,7 @@ func (s *Store) AddressEvents(address types.Address, offset, limit uint64) (even

func scanSiacoinOutput(s scanner) (sco explorer.SiacoinOutput, err error) {
var spentIndex types.ChainIndex
err = s.Scan(decode(&sco.StateElement.ID), decode(&sco.StateElement.LeafIndex), &sco.Source, decodeNull(&spentIndex), &sco.MaturityHeight, decode(&sco.SiacoinOutput.Address), decode(&sco.SiacoinOutput.Value))
err = s.Scan(decode(&sco.ID), decode(&sco.StateElement.LeafIndex), &sco.Source, decodeNull(&spentIndex), &sco.MaturityHeight, decode(&sco.SiacoinOutput.Address), decode(&sco.SiacoinOutput.Value))
if spentIndex != (types.ChainIndex{}) {
sco.SpentIndex = &spentIndex
}
Expand All @@ -189,7 +189,7 @@ func scanSiacoinOutput(s scanner) (sco explorer.SiacoinOutput, err error) {

func scanSiafundOutput(s scanner) (sfo explorer.SiafundOutput, err error) {
var spentIndex types.ChainIndex
err = s.Scan(decode(&sfo.StateElement.ID), decode(&sfo.StateElement.LeafIndex), decodeNull(&spentIndex), decode(&sfo.ClaimStart), decode(&sfo.SiafundOutput.Address), decode(&sfo.SiafundOutput.Value))
err = s.Scan(decode(&sfo.ID), decode(&sfo.StateElement.LeafIndex), decodeNull(&spentIndex), decode(&sfo.ClaimStart), decode(&sfo.SiafundOutput.Address), decode(&sfo.SiafundOutput.Value))
if spentIndex != (types.ChainIndex{}) {
sfo.SpentIndex = &spentIndex
}
Expand Down
20 changes: 10 additions & 10 deletions persist/sqlite/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ func addSiacoinElements(tx *txn, index types.ChainIndex, spentElements, newEleme
defer stmt.Close()

for _, sce := range newElements {
result, err := stmt.Exec(encode(sce.StateElement.ID), encode(index.ID), encode(sce.StateElement.LeafIndex), int(sce.Source), sce.MaturityHeight, encode(sce.SiacoinOutput.Address), encode(sce.SiacoinOutput.Value), encode(sce.StateElement.LeafIndex))
result, err := stmt.Exec(encode(sce.ID), encode(index.ID), encode(sce.StateElement.LeafIndex), int(sce.Source), sce.MaturityHeight, encode(sce.SiacoinOutput.Address), encode(sce.SiacoinOutput.Value), encode(sce.StateElement.LeafIndex))
if err != nil {
return nil, fmt.Errorf("addSiacoinElements: failed to execute siacoin_elements statement: %w", err)
}
Expand All @@ -517,7 +517,7 @@ func addSiacoinElements(tx *txn, index types.ChainIndex, spentElements, newEleme
return nil, fmt.Errorf("addSiacoinElements: failed to get last insert ID: %w", err)
}

scDBIds[types.SiacoinOutputID(sce.StateElement.ID)] = dbID
scDBIds[sce.ID] = dbID
}
}
if len(spentElements) > 0 {
Expand All @@ -531,7 +531,7 @@ func addSiacoinElements(tx *txn, index types.ChainIndex, spentElements, newEleme
defer stmt.Close()

for _, sce := range spentElements {
result, err := stmt.Exec(encode(sce.StateElement.ID), encode(index.ID), encode(sce.StateElement.LeafIndex), encode(index), int(sce.Source), sce.MaturityHeight, encode(sce.SiacoinOutput.Address), encode(sce.SiacoinOutput.Value), encode(index), encode(sce.StateElement.LeafIndex))
result, err := stmt.Exec(encode(sce.ID), encode(index.ID), encode(sce.StateElement.LeafIndex), encode(index), int(sce.Source), sce.MaturityHeight, encode(sce.SiacoinOutput.Address), encode(sce.SiacoinOutput.Value), encode(index), encode(sce.StateElement.LeafIndex))
if err != nil {
return nil, fmt.Errorf("addSiacoinElements: failed to execute siacoin_elements statement: %w", err)
}
Expand All @@ -541,7 +541,7 @@ func addSiacoinElements(tx *txn, index types.ChainIndex, spentElements, newEleme
return nil, fmt.Errorf("addSiacoinElements: failed to get last insert ID: %w", err)
}

scDBIds[types.SiacoinOutputID(sce.StateElement.ID)] = dbID
scDBIds[types.SiacoinOutputID(sce.ID)] = dbID
}
}

Expand All @@ -561,7 +561,7 @@ func addSiafundElements(tx *txn, index types.ChainIndex, spentElements, newEleme
defer stmt.Close()

for _, sfe := range newElements {
result, err := stmt.Exec(encode(sfe.StateElement.ID), encode(index.ID), encode(sfe.StateElement.LeafIndex), encode(sfe.ClaimStart), encode(sfe.SiafundOutput.Address), encode(sfe.SiafundOutput.Value), encode(sfe.StateElement.LeafIndex))
result, err := stmt.Exec(encode(sfe.ID), encode(index.ID), encode(sfe.StateElement.LeafIndex), encode(sfe.ClaimStart), encode(sfe.SiafundOutput.Address), encode(sfe.SiafundOutput.Value), encode(sfe.StateElement.LeafIndex))
if err != nil {
return nil, fmt.Errorf("addSiafundElements: failed to execute siafund_elements statement: %w", err)
}
Expand All @@ -571,7 +571,7 @@ func addSiafundElements(tx *txn, index types.ChainIndex, spentElements, newEleme
return nil, fmt.Errorf("addSiafundElements: failed to get last insert ID: %w", err)
}

sfDBIds[types.SiafundOutputID(sfe.StateElement.ID)] = dbID
sfDBIds[sfe.ID] = dbID
}
}
if len(spentElements) > 0 {
Expand All @@ -585,7 +585,7 @@ func addSiafundElements(tx *txn, index types.ChainIndex, spentElements, newEleme
defer stmt.Close()

for _, sfe := range spentElements {
result, err := stmt.Exec(encode(sfe.StateElement.ID), encode(index.ID), encode(sfe.StateElement.LeafIndex), encode(index), encode(sfe.ClaimStart), encode(sfe.SiafundOutput.Address), encode(sfe.SiafundOutput.Value), encode(sfe.StateElement.LeafIndex), encode(index))
result, err := stmt.Exec(encode(sfe.ID), encode(index.ID), encode(sfe.StateElement.LeafIndex), encode(index), encode(sfe.ClaimStart), encode(sfe.SiafundOutput.Address), encode(sfe.SiafundOutput.Value), encode(sfe.StateElement.LeafIndex), encode(index))
if err != nil {
return nil, fmt.Errorf("addSiafundElements: failed to execute siafund_elements statement: %w", err)
}
Expand All @@ -595,7 +595,7 @@ func addSiafundElements(tx *txn, index types.ChainIndex, spentElements, newEleme
return nil, fmt.Errorf("addSiafundElements: failed to get last insert ID: %w", err)
}

sfDBIds[types.SiafundOutputID(sfe.StateElement.ID)] = dbID
sfDBIds[sfe.ID] = dbID
}
}
return sfDBIds, nil
Expand Down Expand Up @@ -732,7 +732,7 @@ func addEvents(tx *txn, scDBIds map[types.SiacoinOutputID]int64, fcDBIds map[exp
case *explorer.EventMinerPayout:
_, err = minerPayoutEventStmt.Exec(eventID, scDBIds[types.SiacoinOutputID(event.ID)])
case *explorer.EventContractPayout:
_, err = contractPayoutEventStmt.Exec(eventID, scDBIds[types.SiacoinOutputID(v.SiacoinOutput.StateElement.ID)], fcDBIds[explorer.DBFileContract{ID: types.FileContractID(v.FileContract.StateElement.ID), RevisionNumber: v.FileContract.FileContract.RevisionNumber}], v.Missed)
_, err = contractPayoutEventStmt.Exec(eventID, scDBIds[v.SiacoinOutput.ID], fcDBIds[explorer.DBFileContract{ID: v.FileContract.ID, RevisionNumber: v.FileContract.FileContract.RevisionNumber}], v.Missed)
case *explorer.EventFoundationSubsidy:
_, err = foundationSubsidyEventStmt.Exec(eventID, scDBIds[types.SiacoinOutputID(event.ID)])
default:
Expand Down Expand Up @@ -917,7 +917,7 @@ func updateFileContractElements(tx *txn, revert bool, b types.Block, fces []expl
}

if err := addFC(
types.FileContractID(fce.StateElement.ID),
fce.ID,
fce.StateElement.LeafIndex,
fce.FileContract,
update.Resolved,
Expand Down
14 changes: 7 additions & 7 deletions persist/sqlite/consensus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func TestBalance(t *testing.T) {
parentTxn := types.Transaction{
SiacoinInputs: []types.SiacoinInput{
{
ParentID: types.SiacoinOutputID(utxos[0].ID),
ParentID: utxos[0].ID,
UnlockConditions: unlockConditions,
},
},
Expand Down Expand Up @@ -240,7 +240,7 @@ func TestSiafundBalance(t *testing.T) {
parentTxn := types.Transaction{
SiafundInputs: []types.SiafundInput{
{
ParentID: types.SiafundOutputID(genesisBlock.Transactions[0].SiafundOutputID(0)),
ParentID: genesisBlock.Transactions[0].SiafundOutputID(0),
UnlockConditions: unlockConditions,
},
},
Expand Down Expand Up @@ -356,7 +356,7 @@ func TestSendTransactions(t *testing.T) {
parentTxn := types.Transaction{
SiacoinInputs: []types.SiacoinInput{
{
ParentID: types.SiacoinOutputID(scOutputID),
ParentID: scOutputID,
UnlockConditions: unlockConditions,
},
},
Expand All @@ -379,7 +379,7 @@ func TestSendTransactions(t *testing.T) {
}

testutil.SignTransaction(cm.TipState(), pk1, &parentTxn)
scOutputID = types.Hash256(parentTxn.SiacoinOutputID(2))
scOutputID = parentTxn.SiacoinOutputID(2)
sfOutputID = parentTxn.SiafundOutputID(2)

// Mine a block with the above transaction
Expand Down Expand Up @@ -1220,7 +1220,7 @@ func TestRevertBalance(t *testing.T) {
parentTxn := types.Transaction{
SiacoinInputs: []types.SiacoinInput{
{
ParentID: types.SiacoinOutputID(utxos2[0].ID),
ParentID: utxos2[0].ID,
UnlockConditions: unlockConditions,
},
},
Expand Down Expand Up @@ -1415,7 +1415,7 @@ func TestRevertSendTransactions(t *testing.T) {
parentTxn := types.Transaction{
SiacoinInputs: []types.SiacoinInput{
{
ParentID: types.SiacoinOutputID(scOutputID),
ParentID: scOutputID,
UnlockConditions: unlockConditions,
},
},
Expand All @@ -1438,7 +1438,7 @@ func TestRevertSendTransactions(t *testing.T) {
}

testutil.SignTransaction(cm.TipState(), pk1, &parentTxn)
scOutputID = types.Hash256(parentTxn.SiacoinOutputID(2))
scOutputID = parentTxn.SiacoinOutputID(2)
sfOutputID = parentTxn.SiafundOutputID(2)

// Mine a block with the above transaction
Expand Down
2 changes: 1 addition & 1 deletion persist/sqlite/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func encodedIDs(ids []types.FileContractID) []any {
func scanFileContract(s scanner) (contractID int64, fc explorer.FileContract, err error) {
var confirmationIndex, proofIndex types.ChainIndex
var confirmationTransactionID, proofTransactionID types.TransactionID
err = s.Scan(&contractID, decode(&fc.StateElement.ID), decode(&fc.StateElement.LeafIndex), &fc.Resolved, &fc.Valid, decode(&fc.TransactionID), decodeNull(&confirmationIndex), decodeNull(&confirmationTransactionID), decodeNull(&proofIndex), decodeNull(&proofTransactionID), decode(&fc.FileContract.Filesize), decode(&fc.FileContract.FileMerkleRoot), decode(&fc.FileContract.WindowStart), decode(&fc.FileContract.WindowEnd), decode(&fc.FileContract.Payout), decode(&fc.FileContract.UnlockHash), decode(&fc.FileContract.RevisionNumber))
err = s.Scan(&contractID, decode(&fc.ID), decode(&fc.StateElement.LeafIndex), &fc.Resolved, &fc.Valid, decode(&fc.TransactionID), decodeNull(&confirmationIndex), decodeNull(&confirmationTransactionID), decodeNull(&proofIndex), decodeNull(&proofTransactionID), decode(&fc.FileContract.Filesize), decode(&fc.FileContract.FileMerkleRoot), decode(&fc.FileContract.WindowStart), decode(&fc.FileContract.WindowEnd), decode(&fc.FileContract.Payout), decode(&fc.FileContract.UnlockHash), decode(&fc.FileContract.RevisionNumber))

if confirmationIndex != (types.ChainIndex{}) {
fc.ConfirmationIndex = &confirmationIndex
Expand Down
Loading

0 comments on commit 408dd43

Please sign in to comment.