Skip to content

Commit

Permalink
stores: fix metadata unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Nov 7, 2023
1 parent d8661f0 commit 74ce8b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 0 additions & 4 deletions stores/hostdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ const (
// database per batch. Empirically tested to verify that this is a value
// that performs reasonably well.
hostRetrievalBatchSize = 10000

// number of blocks between a contract's 'startHeight' and the block we
// delete the contract if it hasn't appeared on-chain yet.
pendingContractPruneThreshold = 18
)

var (
Expand Down
6 changes: 6 additions & 0 deletions stores/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ func TestSQLContractStore(t *testing.T) {
HostIP: "address",
HostKey: hk,
StartHeight: 100,
State: api.ContractStatePending,
WindowStart: 400,
WindowEnd: 500,
RenewedFrom: types.FileContractID{},
Expand Down Expand Up @@ -640,6 +641,7 @@ func TestRenewedContract(t *testing.T) {
StartHeight: newContractStartHeight,
RenewedFrom: fcid1,
Size: rhpv2.SectorSize,
State: api.ContractStatePending,
Spending: api.ContractSpending{
Uploads: types.ZeroCurrency,
Downloads: types.ZeroCurrency,
Expand Down Expand Up @@ -678,6 +680,7 @@ func TestRenewedContract(t *testing.T) {
WindowStart: 2,
WindowEnd: 3,
Size: rhpv2.SectorSize,
State: contractStatePending,

UploadSpending: currency(types.Siacoins(1)),
DownloadSpending: currency(types.Siacoins(2)),
Expand Down Expand Up @@ -755,6 +758,7 @@ func TestAncestorsContracts(t *testing.T) {
RenewedTo: fcids[len(fcids)-1-i],
StartHeight: 2,
Size: 4096,
State: api.ContractStatePending,
WindowStart: 400,
WindowEnd: 500,
}) {
Expand Down Expand Up @@ -1067,6 +1071,7 @@ func TestSQLMetadataStore(t *testing.T) {
WindowStart: 400,
WindowEnd: 500,
Size: 4096,
State: contractStatePending,

UploadSpending: zeroCurrency,
DownloadSpending: zeroCurrency,
Expand Down Expand Up @@ -1104,6 +1109,7 @@ func TestSQLMetadataStore(t *testing.T) {
WindowStart: 400,
WindowEnd: 500,
Size: 4096,
State: contractStatePending,

UploadSpending: zeroCurrency,
DownloadSpending: zeroCurrency,
Expand Down

0 comments on commit 74ce8b2

Please sign in to comment.