2021-01-26 10:27:30 +00:00
|
|
|
package audit
|
|
|
|
|
|
|
|
import (
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/processors/settlement/common"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/audit"
|
|
|
|
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
2021-01-26 10:27:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// CalculatorPrm groups the parameters of Calculator's constructor.
|
|
|
|
type CalculatorPrm struct {
|
|
|
|
ResultStorage ResultStorage
|
|
|
|
|
2021-02-01 12:40:07 +00:00
|
|
|
ContainerStorage common.ContainerStorage
|
2021-01-26 10:27:30 +00:00
|
|
|
|
2021-02-01 12:40:07 +00:00
|
|
|
PlacementCalculator common.PlacementCalculator
|
2021-01-26 10:27:30 +00:00
|
|
|
|
|
|
|
SGStorage SGStorage
|
|
|
|
|
2021-02-01 12:40:07 +00:00
|
|
|
AccountStorage common.AccountStorage
|
2021-01-26 10:27:30 +00:00
|
|
|
|
2021-02-01 12:40:07 +00:00
|
|
|
Exchanger common.Exchanger
|
2021-04-07 10:51:47 +00:00
|
|
|
|
|
|
|
AuditFeeFetcher FeeFetcher
|
2021-01-26 10:27:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ResultStorage is an interface of storage of the audit results.
|
|
|
|
type ResultStorage interface {
|
|
|
|
// Must return all audit results by epoch number.
|
|
|
|
AuditResultsForEpoch(epoch uint64) ([]*audit.Result, error)
|
|
|
|
}
|
|
|
|
|
2023-02-05 15:59:38 +00:00
|
|
|
// SGInfo groups the data about FrostFS storage group
|
2021-01-26 10:27:30 +00:00
|
|
|
// necessary for calculating audit fee.
|
|
|
|
type SGInfo interface {
|
|
|
|
// Must return sum size of the all group members.
|
|
|
|
Size() uint64
|
|
|
|
}
|
|
|
|
|
|
|
|
// SGStorage is an interface of storage of the storage groups.
|
|
|
|
type SGStorage interface {
|
|
|
|
// Must return information about the storage group by address.
|
2022-05-31 17:00:41 +00:00
|
|
|
SGInfo(oid.Address) (SGInfo, error)
|
2021-01-26 10:27:30 +00:00
|
|
|
}
|
2021-04-07 10:51:47 +00:00
|
|
|
|
|
|
|
// FeeFetcher wraps AuditFee method that returns audit fee price from
|
|
|
|
// the network configuration.
|
|
|
|
type FeeFetcher interface {
|
|
|
|
AuditFee() (uint64, error)
|
|
|
|
}
|