@@ -17,18 +17,17 @@ import (
1717const TableNameSettings = "settings"
1818
1919type Settings struct {
20- ID string `gorm:"column:id;size:10;primaryKey"`
21- Capacity int64 `gorm:"column:capacity;not null;default:0"`
22- ChallengeCompletionTime string `gorm:"column:challenge_completion_time;size:30;default:'-1ns';not null"`
23- MaxOfferDuration string `gorm:"column:max_offer_duration;size:30;default:'-1ns';not null"`
24- MaxStake int64 `gorm:"column:max_stake;not null;default:100"`
25- MinLockDemand float64 `gorm:"column:min_lock_demand;not null;default:0"`
26- MinStake int64 `gorm:"column:min_stake;not null;default:1"`
27- NumDelegates int `gorm:"column:num_delegates;not null;default:100"`
28- ReadPrice float64 `gorm:"column:read_price;not null;default:0"`
29- WritePrice float64 `gorm:"column:write_price;not null;default:0"`
30- ServiceCharge float64 `gorm:"column:service_charge;not null;default:0"`
31- UpdatedAt time.Time `gorm:"column:updated_at;not null;default:NOW()"`
20+ ID string `gorm:"column:id;size:10;primaryKey"`
21+ Capacity int64 `gorm:"column:capacity;not null;default:0"`
22+ MaxOfferDuration string `gorm:"column:max_offer_duration;size:30;default:'-1ns';not null"`
23+ MaxStake int64 `gorm:"column:max_stake;not null;default:100"`
24+ MinLockDemand float64 `gorm:"column:min_lock_demand;not null;default:0"`
25+ MinStake int64 `gorm:"column:min_stake;not null;default:1"`
26+ NumDelegates int `gorm:"column:num_delegates;not null;default:100"`
27+ ReadPrice float64 `gorm:"column:read_price;not null;default:0"`
28+ WritePrice float64 `gorm:"column:write_price;not null;default:0"`
29+ ServiceCharge float64 `gorm:"column:service_charge;not null;default:0"`
30+ UpdatedAt time.Time `gorm:"column:updated_at;not null;default:NOW()"`
3231}
3332
3433func (s Settings ) TableName () string {
@@ -43,11 +42,6 @@ func (s *Settings) CopyTo(c *Config) error {
4342}
4443
4544c .Capacity = s .Capacity
46- cct , err := time .ParseDuration (s .ChallengeCompletionTime )
47- if err != nil {
48- return errors .Throw (constants .ErrInvalidParameter , "ChallengeCompletionTime" )
49- }
50- c .ChallengeCompletionTime = cct
5145
5246maxOfferDuration , err := time .ParseDuration (s .MaxOfferDuration )
5347if err != nil {
@@ -72,7 +66,6 @@ func (s *Settings) CopyFrom(c *Config) error {
7266}
7367
7468s .Capacity = c .Capacity
75- s .ChallengeCompletionTime = c .ChallengeCompletionTime .String ()
7669s .MaxOfferDuration = c .MaxOfferDuration .String ()
7770s .MaxStake = c .MaxStake
7871s .MinLockDemand = c .MinLockDemand
@@ -138,7 +131,6 @@ func ReloadFromChain(ctx context.Context, db *gorm.DB) (*zcncore.Blobber, error)
138131}
139132
140133Configuration .Capacity = int64 (b .Capacity )
141- Configuration .ChallengeCompletionTime = b .Terms .ChallengeCompletionTime
142134Configuration .MaxOfferDuration = b .Terms .MaxOfferDuration
143135Configuration .MaxStake = int64 (b .StakePoolSettings .MaxStake )
144136Configuration .MinLockDemand = b .Terms .MinLockDemand
0 commit comments