-
Notifications
You must be signed in to change notification settings - Fork 175
/
updatable_configs.go
30 lines (27 loc) · 1.18 KB
/
updatable_configs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package module
// SealingConfigsGetter is an interface for the actual updatable configs module.
// but only exposes its getter methods to return the config values without exposing
// its setter methods.
// SealingConfigs contains three configs:
// - RequireApprovalsForSealingConstruction (updatable)
// - RequireApprovalsForSealingVerification (not-updatable)
// - ChunkAlpha (not-updatable)
// - EmergencySealingActive (not-updatable)
// - ApprovalRequestsThreshold (not-updatable)
type SealingConfigsGetter interface {
// updatable fields
RequireApprovalsForSealConstructionDynamicValue() uint
// not-updatable fields
ChunkAlphaConst() uint
RequireApprovalsForSealVerificationConst() uint
EmergencySealingActiveConst() bool
ApprovalRequestsThresholdConst() uint64
}
// SealingConfigsSetter is an interface that allows the caller to update updatable configs
type SealingConfigsSetter interface {
SealingConfigsGetter
// SetRequiredApprovalsForSealingConstruction takes a new value and returns the old value
// if the new value is valid. otherwise returns an error,
// and the value is not updated (equivalent to no-op)
SetRequiredApprovalsForSealingConstruction(newVal uint) (uint, error)
}