Skip to content

Commit

Permalink
address comment and use testutil.NewEphemeralContractor in test host
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Dec 16, 2024
1 parent 984cea6 commit 535c1f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/rhp/v4/rhp.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (c *Client) FundAccounts(ctx context.Context, hk types.PublicKey, hostIP st

// LatestRevision returns the latest revision of a contract.
func (c *Client) LatestRevision(ctx context.Context, hk types.PublicKey, addr string, contractID types.FileContractID) (revision types.V2FileContract, _ error) {
err := c.tpool.withTransport(ctx, hk, addr, func(c rhp.TransportClient) (err error) {
err := c.tpool.withTransport(ctx, hk, addr, func(c rhp.TransportClient) error {
res, err := rhp.RPCLatestRevision(ctx, c, contractID)
revision = res.Contract
return err
Expand Down
3 changes: 2 additions & 1 deletion internal/test/e2e/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"go.sia.tech/coreutils/chain"
rhp4 "go.sia.tech/coreutils/rhp/v4"
"go.sia.tech/coreutils/syncer"
"go.sia.tech/coreutils/testutil"
"go.sia.tech/coreutils/wallet"
"go.sia.tech/hostd/host/accounts"
"go.sia.tech/hostd/host/contracts"
Expand Down Expand Up @@ -307,7 +308,7 @@ 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, contracts, wallet, settings, storage, rhp4.WithPriceTableValidity(30*time.Minute))
rhpv4 := rhp4.NewServer(privKey, cm, s, testutil.NewEphemeralContractor(cm), wallet, settings, storage, rhp4.WithPriceTableValidity(30*time.Minute))
go rhp.ServeRHP4SiaMux(rhp4Listener, rhpv4, log.Named("rhp4"))

return &Host{
Expand Down

0 comments on commit 535c1f5

Please sign in to comment.