events: Fix nnoce check in CheckMsg

This commit is contained in:
Łukasz Magiera 2019-11-24 20:16:34 +01:00
parent a755ca5dae
commit 3cf97c4278
2 changed files with 2 additions and 23 deletions

View File

@ -1,22 +0,0 @@
package actors
import (
"fmt"
"github.com/filecoin-project/lotus/build"
"gotest.tools/assert"
"testing"
)
func TestProvingPeriodEnd(t *testing.T) {
assertPPE := func(setPeriodEnd uint64, height uint64, expectEnd uint64) {
end, _ := ProvingPeriodEnd(setPeriodEnd, height)
assert.Equal(t, expectEnd, end)
assert.Equal(t, expectEnd, end)
fmt.Println(end)
fmt.Println(end - build.PoStChallangeTime)
}
// assumes proving dur of 40 epochs
assertPPE(185, 147, 185)
}

View File

@ -18,7 +18,8 @@ func (e *calledEvents) CheckMsg(ctx context.Context, smsg store.ChainMsg, hnd Ca
return false, true, err
}
if msg.Nonce > fa.Nonce {
// >= because actor nonce is actually the next nonce that is expected to appear on chain
if msg.Nonce >= fa.Nonce {
return false, true, nil
}