Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HostSettings Value Receiver #128

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rhp/v2/rhp.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func (c RPCCost) Total() (cost, collateral types.Currency) {
}

// RPCReadCost returns the cost of a Read RPC.
func (hs *HostSettings) RPCReadCost(sections []RPCReadRequestSection, proof bool) (RPCCost, error) {
func (hs HostSettings) RPCReadCost(sections []RPCReadRequestSection, proof bool) (RPCCost, error) {
// validate the request sections and calculate the cost
var bandwidth uint64
for _, sec := range sections {
Expand Down Expand Up @@ -355,7 +355,7 @@ func (hs *HostSettings) RPCReadCost(sections []RPCReadRequestSection, proof bool
}

// RPCSectorRootsCost returns the cost of a SectorRoots RPC.
func (hs *HostSettings) RPCSectorRootsCost(rootOffset, numRoots uint64) RPCCost {
func (hs HostSettings) RPCSectorRootsCost(rootOffset, numRoots uint64) RPCCost {
proofSize := RangeProofSize(LeavesPerSector, rootOffset, rootOffset+numRoots)
return RPCCost{
Base: hs.BaseRPCPrice,
Expand All @@ -364,7 +364,7 @@ func (hs *HostSettings) RPCSectorRootsCost(rootOffset, numRoots uint64) RPCCost
}

// RPCWriteCost returns the cost of a Write RPC.
func (hs *HostSettings) RPCWriteCost(actions []RPCWriteAction, oldSectors, remainingDuration uint64, proof bool) (RPCCost, error) {
func (hs HostSettings) RPCWriteCost(actions []RPCWriteAction, oldSectors, remainingDuration uint64, proof bool) (RPCCost, error) {
var uploadBytes uint64
newSectors := oldSectors
for _, action := range actions {
Expand Down