From 3cf97c4278fc1895ffe4a9aa93122d34a1f810a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sun, 24 Nov 2019 20:16:34 +0100 Subject: [PATCH] events: Fix nnoce check in CheckMsg --- chain/actors/actor_miner_test.go | 22 ---------------------- chain/events/utils.go | 3 ++- 2 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 chain/actors/actor_miner_test.go diff --git a/chain/actors/actor_miner_test.go b/chain/actors/actor_miner_test.go deleted file mode 100644 index 309db1acb..000000000 --- a/chain/actors/actor_miner_test.go +++ /dev/null @@ -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) -} diff --git a/chain/events/utils.go b/chain/events/utils.go index eebd8fd1d..ba8083f9b 100644 --- a/chain/events/utils.go +++ b/chain/events/utils.go @@ -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 }