events: Fix double apply in events.Called as well
This commit is contained in:
parent
7d80cbfbdf
commit
631a9cd3b6
@ -183,6 +183,10 @@ func (e *calledEvents) applyWithConfidence(ts *types.TipSet) {
|
||||
}
|
||||
|
||||
for _, event := range events {
|
||||
if event.called {
|
||||
continue
|
||||
}
|
||||
|
||||
trigger := e.triggers[event.trigger]
|
||||
if trigger.disabled {
|
||||
continue
|
||||
|
@ -604,6 +604,12 @@ func TestCalled(t *testing.T) {
|
||||
require.Equal(t, false, reverted)
|
||||
applied = false
|
||||
|
||||
// dip below confidence
|
||||
fcs.advance(2, 2, nil) // H=10 (confidence=3, apply)
|
||||
|
||||
require.Equal(t, false, applied)
|
||||
require.Equal(t, false, reverted)
|
||||
|
||||
require.Equal(t, uint64(7), appliedTs.Height())
|
||||
require.Equal(t, "bafkqaaa", appliedTs.Blocks()[0].Messages.String())
|
||||
require.Equal(t, uint64(10), appliedH)
|
||||
|
Loading…
Reference in New Issue
Block a user