diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-12-17 15:44:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-17 15:44:10 +0800 |
commit | ff845cd0bddcaacb8d88da9296af22a45fef1dff (patch) | |
tree | cd7627d760817148afe7f4a3299dbf9f6a4eca4b /core/test/app_test.go | |
parent | 99d72382687196fb15ea6ab0fcf297b9ab10ac46 (diff) | |
download | tangerine-consensus-ff845cd0bddcaacb8d88da9296af22a45fef1dff.tar.gz tangerine-consensus-ff845cd0bddcaacb8d88da9296af22a45fef1dff.tar.zst tangerine-consensus-ff845cd0bddcaacb8d88da9296af22a45fef1dff.zip |
test: check causality (#372)
Diffstat (limited to 'core/test/app_test.go')
-rw-r--r-- | core/test/app_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/test/app_test.go b/core/test/app_test.go index 61672a4..80580a3 100644 --- a/core/test/app_test.go +++ b/core/test/app_test.go @@ -179,6 +179,21 @@ func (s *AppTestSuite) TestVerify() { time.Duration(len(app6.DeliverSequence))*time.Second), uint64(len(app6.DeliverSequence)+2)) req.Equal(ErrConsensusHeightOutOfOrder, app6.Verify()) + // Test the acking block doesn't delivered. + app7 := NewApp(nil) + // Patch a block's acks. + b7 := &types.Block{ + Hash: common.NewRandomHash(), + Acks: common.NewSortedHashes(common.Hashes{common.NewRandomHash()}), + } + app7.BlockConfirmed(*b7) + app7.TotalOrderingDelivered( + common.Hashes{b7.Hash}, core.TotalOrderingModeNormal) + app7.BlockDelivered(b7.Hash, types.Position{}, types.FinalizationResult{ + Timestamp: time.Now(), + Height: 1, + }) + req.Equal(ErrAckingBlockNotDelivered, app7.Verify()) } func TestApp(t *testing.T) { |