You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
522 B
22 lines
522 B
5 years ago
|
package shardingconfig
|
||
|
|
||
|
import (
|
||
|
"math/big"
|
||
|
)
|
||
|
|
||
|
type fixedSchedule struct {
|
||
|
instance Instance
|
||
|
}
|
||
|
|
||
|
// InstanceForEpoch returns the fixed sharding configuration instance regardless
|
||
|
// the given epoch.
|
||
|
func (s fixedSchedule) InstanceForEpoch(epoch *big.Int) Instance {
|
||
|
return s.instance
|
||
|
}
|
||
|
|
||
|
// NewFixedSchedule returns a sharding configuration schedule that uses the
|
||
|
// given config instance for all epochs. Useful for testing.
|
||
|
func NewFixedSchedule(instance Instance) Schedule {
|
||
|
return fixedSchedule{instance: instance}
|
||
|
}
|