diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-08-22 11:33:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-22 11:33:39 +0800 |
commit | 89a65a152ae7956bcf6d241eb15d66e6d955b819 (patch) | |
tree | ec157eab266cf3dd76a94cfdbe90d35a08a2e492 /core/test/app_test.go | |
parent | 2c816b5d636b8f7decd234582470a3d4c6b4a93a (diff) | |
download | tangerine-consensus-89a65a152ae7956bcf6d241eb15d66e6d955b819.tar tangerine-consensus-89a65a152ae7956bcf6d241eb15d66e6d955b819.tar.gz tangerine-consensus-89a65a152ae7956bcf6d241eb15d66e6d955b819.tar.bz2 tangerine-consensus-89a65a152ae7956bcf6d241eb15d66e6d955b819.tar.lz tangerine-consensus-89a65a152ae7956bcf6d241eb15d66e6d955b819.tar.xz tangerine-consensus-89a65a152ae7956bcf6d241eb15d66e6d955b819.tar.zst tangerine-consensus-89a65a152ae7956bcf6d241eb15d66e6d955b819.zip |
core: Notary ack application. (#70)
Diffstat (limited to 'core/test/app_test.go')
-rw-r--r-- | core/test/app_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/core/test/app_test.go b/core/test/app_test.go index f4c4a74..6966de5 100644 --- a/core/test/app_test.go +++ b/core/test/app_test.go @@ -1,3 +1,20 @@ +// Copyright 2018 The dexon-consensus-core Authors +// This file is part of the dexon-consensus-core library. +// +// The dexon-consensus-core library is free software: you can redistribute it +// and/or modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// The dexon-consensus-core library is distributed in the hope that it will be +// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +// General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the dexon-consensus-core library. If not, see +// <http://www.gnu.org/licenses/>. + package test import ( @@ -5,6 +22,7 @@ import ( "time" "github.com/dexon-foundation/dexon-consensus-core/common" + "github.com/dexon-foundation/dexon-consensus-core/core/types" "github.com/stretchr/testify/suite" ) @@ -135,6 +153,14 @@ func (s *AppTestSuite) TestVerify() { app4.StronglyAcked(hash) app4.TotalOrderingDeliver(common.Hashes{hash}, false) s.deliverBlockWithTimeFromSequenceLength(app4, hash) + // Notary ack on unknown block. + app5 := NewApp() + s.setupAppByTotalOrderDeliver(app5, s.to1) + app5.NotaryAckDeliver(&types.NotaryAck{ + Hash: common.NewRandomHash(), + NotaryBlockHash: common.NewRandomHash(), + }) + req.Equal(ErrNotaryAckUnknownBlock, app5.Verify()) } func TestApp(t *testing.T) { |