Skip to content

Commit

Permalink
Merge branch 'dev' into chris/rename-scan-failures
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl authored Aug 28, 2024
2 parents 47f893d + b9ec530 commit 131527f
Show file tree
Hide file tree
Showing 50 changed files with 1,618 additions and 1,901 deletions.
4 changes: 2 additions & 2 deletions alerts/alerts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func TestWebhooks(t *testing.T) {
mux := http.NewServeMux()
var events []webhooks.Event
var mu sync.Mutex
mux.HandleFunc("/events", func(w http.ResponseWriter, r *http.Request) {
mux.HandleFunc("/event", func(w http.ResponseWriter, r *http.Request) {
var event webhooks.Event
if err := json.NewDecoder(r.Body).Decode(&event); err != nil {
t.Fatal(err)
Expand All @@ -72,7 +72,7 @@ func TestWebhooks(t *testing.T) {
// register a hook
wh := webhooks.Webhook{
Module: webhookModule,
URL: fmt.Sprintf("http://%v/events", srv.Listener.Addr().String()),
URL: fmt.Sprintf("http://%v/event", srv.Listener.Addr().String()),
}
if hookID := wh.String(); hookID != fmt.Sprintf("%v.%v.%v", wh.URL, wh.Module, "") {
t.Fatalf("wrong result for wh.String(): %v != %v", wh.String(), hookID)
Expand Down
4 changes: 4 additions & 0 deletions api/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ type (
// an account and the balance reported by a host.
Drift *big.Int `json:"drift"`

// Owner is the owner of the account which is responsible for funding
// it.
Owner string `json:"owner"`

// RequiresSync indicates whether an account needs to be synced with the
// host before it can be used again.
RequiresSync bool `json:"requiresSync"`
Expand Down
4 changes: 4 additions & 0 deletions api/bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ type (
)

type (
AccountsSaveRequest struct {
Accounts []Account `json:"accounts"`
}

// BusStateResponse is the response type for the /bus/state endpoint.
BusStateResponse struct {
StartTime TimeRFC3339 `json:"startTime"`
Expand Down
10 changes: 10 additions & 0 deletions api/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ type (
TotalCost types.Currency `json:"totalCost"`
}

// ContractFormRequest is the request type for the POST /contracts endpoint.
ContractFormRequest struct {
EndHeight uint64 `json:"endHeight"`
HostCollateral types.Currency `json:"hostCollateral"`
HostKey types.PublicKey `json:"hostKey"`
HostIP string `json:"hostIP"`
RenterFunds types.Currency `json:"renterFunds"`
RenterAddress types.Address `json:"renterAddress"`
}

// ContractKeepaliveRequest is the request type for the /contract/:id/keepalive
// endpoint.
ContractKeepaliveRequest struct {
Expand Down
13 changes: 0 additions & 13 deletions api/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"net/url"
"time"

rhpv2 "go.sia.tech/core/rhp/v2"
rhpv3 "go.sia.tech/core/rhp/v3"
"go.sia.tech/core/types"
)
Expand Down Expand Up @@ -45,18 +44,6 @@ type (
DependsOn []types.Transaction `json:"dependsOn"`
}

// WalletPrepareFormRequest is the request type for the /wallet/prepare/form
// endpoint.
WalletPrepareFormRequest struct {
EndHeight uint64 `json:"endHeight"`
HostCollateral types.Currency `json:"hostCollateral"`
HostKey types.PublicKey `json:"hostKey"`
HostSettings rhpv2.HostSettings `json:"hostSettings"`
RenterAddress types.Address `json:"renterAddress"`
RenterFunds types.Currency `json:"renterFunds"`
RenterKey types.PublicKey `json:"renterKey"`
}

// WalletPrepareRenewRequest is the request type for the /wallet/prepare/renew
// endpoint.
WalletPrepareRenewRequest struct {
Expand Down
18 changes: 0 additions & 18 deletions api/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,31 +80,13 @@ type (
Error string `json:"error,omitempty"`
}

// RHPFormRequest is the request type for the /rhp/form endpoint.
RHPFormRequest struct {
EndHeight uint64 `json:"endHeight"`
HostCollateral types.Currency `json:"hostCollateral"`
HostKey types.PublicKey `json:"hostKey"`
HostIP string `json:"hostIP"`
RenterFunds types.Currency `json:"renterFunds"`
RenterAddress types.Address `json:"renterAddress"`
}

// RHPFormResponse is the response type for the /rhp/form endpoint.
RHPFormResponse struct {
ContractID types.FileContractID `json:"contractID"`
Contract rhpv2.ContractRevision `json:"contract"`
TransactionSet []types.Transaction `json:"transactionSet"`
}

// RHPFundRequest is the request type for the /rhp/fund endpoint.
RHPFundRequest struct {
ContractID types.FileContractID `json:"contractID"`
HostKey types.PublicKey `json:"hostKey"`
SiamuxAddr string `json:"siamuxAddr"`
Balance types.Currency `json:"balance"`
}

// RHPPruneContractRequest is the request type for the /rhp/contract/:id/prune
// endpoint.
RHPPruneContractRequest struct {
Expand Down
Loading

0 comments on commit 131527f

Please sign in to comment.