diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-08-20 14:03:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-20 14:03:18 +0800 |
commit | 1e71e263e063adbe7e44d48818f9c74924a2945d (patch) | |
tree | b874d8d4d6cc1d0aa6f106f276f83706361f0878 /core/nonblocking-application_test.go | |
parent | d9ba7986a975615fb10790cfd448c48c89c1a7b3 (diff) | |
download | dexon-consensus-1e71e263e063adbe7e44d48818f9c74924a2945d.tar dexon-consensus-1e71e263e063adbe7e44d48818f9c74924a2945d.tar.gz dexon-consensus-1e71e263e063adbe7e44d48818f9c74924a2945d.tar.bz2 dexon-consensus-1e71e263e063adbe7e44d48818f9c74924a2945d.tar.lz dexon-consensus-1e71e263e063adbe7e44d48818f9c74924a2945d.tar.xz dexon-consensus-1e71e263e063adbe7e44d48818f9c74924a2945d.tar.zst dexon-consensus-1e71e263e063adbe7e44d48818f9c74924a2945d.zip |
core: NotaryAck interfaces. (#67)
Diffstat (limited to 'core/nonblocking-application_test.go')
-rw-r--r-- | core/nonblocking-application_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/nonblocking-application_test.go b/core/nonblocking-application_test.go index 070eae3..0f7d7f2 100644 --- a/core/nonblocking-application_test.go +++ b/core/nonblocking-application_test.go @@ -24,6 +24,7 @@ import ( "github.com/stretchr/testify/suite" "github.com/dexon-foundation/dexon-consensus-core/common" + "github.com/dexon-foundation/dexon-consensus-core/core/types" ) type slowApp struct { @@ -31,6 +32,7 @@ type slowApp struct { stronglyAcked map[common.Hash]struct{} totalOrderingDeliver map[common.Hash]struct{} deliverBlock map[common.Hash]struct{} + notaryAck map[common.Hash]struct{} } func newSlowApp(sleep time.Duration) *slowApp { @@ -39,6 +41,7 @@ func newSlowApp(sleep time.Duration) *slowApp { stronglyAcked: make(map[common.Hash]struct{}), totalOrderingDeliver: make(map[common.Hash]struct{}), deliverBlock: make(map[common.Hash]struct{}), + notaryAck: make(map[common.Hash]struct{}), } } @@ -59,6 +62,11 @@ func (app *slowApp) DeliverBlock(blockHash common.Hash, timestamp time.Time) { app.deliverBlock[blockHash] = struct{}{} } +func (app *slowApp) NotaryAck(notaryAck types.NotaryAck) { + time.Sleep(app.sleep) + app.notaryAck[notaryAck.Hash] = struct{}{} +} + type NonBlockingAppTestSuite struct { suite.Suite } |