Fix tests
This commit is contained in:
parent
b001a73da1
commit
52ff34c13e
@ -50,6 +50,9 @@ func TestHappyPath(t *testing.T) {
|
||||
require.Equal(m.t, m.state.State, api.CommitWait)
|
||||
|
||||
m.planSingle(SectorProving{})
|
||||
require.Equal(m.t, m.state.State, api.FinalizeSector)
|
||||
|
||||
m.planSingle(SectorFinalized{})
|
||||
require.Equal(m.t, m.state.State, api.Proving)
|
||||
}
|
||||
|
||||
@ -81,6 +84,9 @@ func TestSeedRevert(t *testing.T) {
|
||||
require.Equal(m.t, m.state.State, api.CommitWait)
|
||||
|
||||
m.planSingle(SectorProving{})
|
||||
require.Equal(m.t, m.state.State, api.FinalizeSector)
|
||||
|
||||
m.planSingle(SectorFinalized{})
|
||||
require.Equal(m.t, m.state.State, api.Proving)
|
||||
}
|
||||
|
||||
|
4
utils.go
4
utils.go
@ -49,11 +49,11 @@ func fillersFromRem(toFill uint64) ([]uint64, error) {
|
||||
|
||||
func (m *Sealing) fastPledgeCommitment(size uint64, parts uint64) (commP [sectorbuilder.CommLen]byte, err error) {
|
||||
parts = 1 << bits.Len64(parts) // round down to nearest power of 2
|
||||
if size / parts < 127 {
|
||||
if size/parts < 127 {
|
||||
parts = size / 127
|
||||
}
|
||||
|
||||
piece := sectorbuilder.UserBytesForSectorSize((size + size / 127) / parts)
|
||||
piece := sectorbuilder.UserBytesForSectorSize((size + size/127) / parts)
|
||||
out := make([]sectorbuilder.PublicPieceInfo, parts)
|
||||
var lk sync.Mutex
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user