pull out constant

This commit is contained in:
whyrusleeping 2019-07-15 10:48:59 -07:00
parent 1aa3cf3043
commit c44eeab51a
2 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,8 @@ import (
"github.com/libp2p/go-libp2p-core/peer"
)
const SectorSize = 1024
func init() {
cbor.RegisterCborType(StorageMarketState{})
cbor.RegisterCborType(CreateStorageMinerParams{})
@ -90,7 +92,7 @@ func (sma StorageMarketActor) CreateStorageMiner(act *types.Actor, vmctx types.V
}
func SupportedSectorSize(ssize types.BigInt) bool {
if ssize.Uint64() == 1024 {
if ssize.Uint64() == SectorSize {
return true
}
return false

View File

@ -103,7 +103,7 @@ func TestStorageMarketActorCreateMiner(t *testing.T) {
params := &StorageMinerConstructorParams{
Worker: maddr,
SectorSize: types.NewInt(1024),
SectorSize: types.NewInt(SectorSize),
PeerID: "fakepeerid",
}
enc, err := cbor.DumpObject(params)