Skip to content

Commit

Permalink
fix TestSectorPruning
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Dec 16, 2024
1 parent 7c6daf5 commit cdf96cd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
8 changes: 7 additions & 1 deletion internal/test/e2e/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ func (tc *TestCluster) ContractRoots(ctx context.Context, fcid types.FileContrac
if h == nil {
return nil, fmt.Errorf("no host found for contract %v", c)
}
return h.contracts.SectorRoots(fcid), nil
var roots []types.Hash256
state, unlock, err := h.contractsV2.LockV2Contract(fcid)
if err == nil {
roots = append(roots, state.Roots...)
defer unlock()
}
return append(roots, h.contracts.SectorRoots(fcid)...), nil
}

func (tc *TestCluster) IsPassedV2AllowHeight() bool {
Expand Down
37 changes: 20 additions & 17 deletions internal/test/e2e/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,15 @@ type Host struct {
s *syncer.Syncer
syncerCancel context.CancelFunc

store *sqlite.Store
wallet *wallet.SingleAddressWallet
settings *settings.ConfigManager
storage *storage.VolumeManager
index *index.Manager
registry *registry.Manager
accounts *accounts.AccountManager
contracts *contracts.Manager
store *sqlite.Store
wallet *wallet.SingleAddressWallet
settings *settings.ConfigManager
storage *storage.VolumeManager
index *index.Manager
registry *registry.Manager
accounts *accounts.AccountManager
contracts *contracts.Manager
contractsV2 *testutil.EphemeralContractor

rhpv2 *rhpv2.SessionHandler
rhpv3 *rhpv3.SessionHandler
Expand Down Expand Up @@ -308,7 +309,8 @@ func NewHost(privKey types.PrivateKey, cm *chain.Manager, dir string, network *c
rhpv3 := rhpv3.NewSessionHandler(rhp3Listener, privKey, cm, s, wallet, accounts, contracts, registry, storage, settings, log.Named("rhpv3"))
go rhpv3.Serve()

rhpv4 := rhp4.NewServer(privKey, cm, s, testutil.NewEphemeralContractor(cm), wallet, settings, storage, rhp4.WithPriceTableValidity(30*time.Minute))
contractsV2 := testutil.NewEphemeralContractor(cm)
rhpv4 := rhp4.NewServer(privKey, cm, s, contractsV2, wallet, settings, storage, rhp4.WithPriceTableValidity(30*time.Minute))
go rhp.ServeRHP4SiaMux(rhp4Listener, rhpv4, log.Named("rhp4"))

return &Host{
Expand All @@ -318,14 +320,15 @@ func NewHost(privKey types.PrivateKey, cm *chain.Manager, dir string, network *c
s: s,
syncerCancel: syncerCancel,

store: db,
wallet: wallet,
settings: settings,
index: idx,
storage: storage,
registry: registry,
accounts: accounts,
contracts: contracts,
store: db,
wallet: wallet,
settings: settings,
index: idx,
storage: storage,
registry: registry,
accounts: accounts,
contracts: contracts,
contractsV2: contractsV2,

rhpv2: rhpv2,
rhpv3: rhpv3,
Expand Down

0 comments on commit cdf96cd

Please sign in to comment.