From f3ae7eb7a3bd2f68ddcf512eb24336012f31e1f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 8 Nov 2019 21:25:02 +0100 Subject: [PATCH] events: Test 2 block tipsets with duplicated message --- chain/events/events_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/chain/events/events_test.go b/chain/events/events_test.go index 27a3edf03..4c5177e1e 100644 --- a/chain/events/events_test.go +++ b/chain/events/events_test.go @@ -46,11 +46,24 @@ func (fcs *fakeCS) ChainGetTipSetByHeight(context.Context, uint64, *types.TipSet func makeTs(t *testing.T, h uint64, msgcid cid.Cid) *types.TipSet { a, _ := address.NewFromString("t00") + b, _ := address.NewFromString("t02") ts, err := types.NewTipSet([]*types.BlockHeader{ { Height: h, Miner: a, + Tickets: []*types.Ticket{{[]byte{byte(h % 2)}}}, + + ParentStateRoot: dummyCid, + Messages: msgcid, + ParentMessageReceipts: dummyCid, + }, + { + Height: h, + Miner: b, + + Tickets: []*types.Ticket{{[]byte{byte((h + 1) % 2)}}}, + ParentStateRoot: dummyCid, Messages: msgcid, ParentMessageReceipts: dummyCid, @@ -494,6 +507,7 @@ func TestCalled(t *testing.T) { err = events.Called(func(ts *types.TipSet) (d bool, m bool, e error) { return false, true, nil }, func(msg *types.Message, ts *types.TipSet, curH uint64) (bool, error) { + require.Equal(t, false, applied) applied = true appliedMsg = msg appliedTs = ts