From c44eeab51a7e1459ea85cf6ee7d7a2cc13907217 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Mon, 15 Jul 2019 10:48:59 -0700 Subject: [PATCH] pull out constant --- chain/actors/actor_storagemarket.go | 4 +++- chain/actors/actors_test.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/chain/actors/actor_storagemarket.go b/chain/actors/actor_storagemarket.go index 2ae622a09..35da19350 100644 --- a/chain/actors/actor_storagemarket.go +++ b/chain/actors/actor_storagemarket.go @@ -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 diff --git a/chain/actors/actors_test.go b/chain/actors/actors_test.go index bd12be01b..8a5fcabbc 100644 --- a/chain/actors/actors_test.go +++ b/chain/actors/actors_test.go @@ -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)