mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-04 20:24:25 -08:00
fixes + test hw edge cases
This commit is contained in:
@@ -152,6 +152,11 @@ func (k *Keeper) ValidateAuctionHardware(ctx sdk.Context, a types.Auction) error
|
||||
return errors.New("GPU list not found")
|
||||
}
|
||||
|
||||
// move these to module params later
|
||||
if len(a.Gpus) == 0 || len(a.Gpus) > 20 {
|
||||
return fmt.Errorf("must order between 1 and 20 GPUs (got %d)", len(a.Gpus))
|
||||
}
|
||||
|
||||
for _, gpu := range a.Gpus {
|
||||
if _, ok := k.GetParams(ctx).GpuModels[gpu]; !ok {
|
||||
return fmt.Errorf("GPU model %s invalid", gpu)
|
||||
@@ -159,11 +164,11 @@ func (k *Keeper) ValidateAuctionHardware(ctx sdk.Context, a types.Auction) error
|
||||
}
|
||||
|
||||
// move these to module params later
|
||||
|
||||
if a.CpuCores < 1 || a.CpuCores > 12 {
|
||||
return fmt.Errorf("CPU Cores must be between 1 and 12 (got %d)", a.CpuCores)
|
||||
}
|
||||
|
||||
// move these to module params later
|
||||
if a.StorageGb < 25 || a.StorageGb > 2000 {
|
||||
return fmt.Errorf("storage must be between 25GB and 2TB (got %dGB)", a.StorageGb)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user