diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-10-11 19:33:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-11 19:33:25 +0800 |
commit | 490fa1e9ce2b661e4c8b612bd53f20123346353b (patch) | |
tree | 2ef4a4fabb1e21d46ef3e47538dadfeecdf2cf4d /core/test/app.go | |
parent | f3e9eb613c7e8dec6b8c6b1b0a20ddbec4e91a9c (diff) | |
download | tangerine-consensus-490fa1e9ce2b661e4c8b612bd53f20123346353b.tar tangerine-consensus-490fa1e9ce2b661e4c8b612bd53f20123346353b.tar.gz tangerine-consensus-490fa1e9ce2b661e4c8b612bd53f20123346353b.tar.bz2 tangerine-consensus-490fa1e9ce2b661e4c8b612bd53f20123346353b.tar.lz tangerine-consensus-490fa1e9ce2b661e4c8b612bd53f20123346353b.tar.xz tangerine-consensus-490fa1e9ce2b661e4c8b612bd53f20123346353b.tar.zst tangerine-consensus-490fa1e9ce2b661e4c8b612bd53f20123346353b.zip |
core: change interface (#193)
* Extract types.FinalizationResult
* Change interface:
- Application.BlockConfirmed returns whole block.
- Application.BlockDelivered returns partial result.
Diffstat (limited to 'core/test/app.go')
-rw-r--r-- | core/test/app.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/test/app.go b/core/test/app.go index bf14d1b..60bc26f 100644 --- a/core/test/app.go +++ b/core/test/app.go @@ -114,7 +114,7 @@ func (app *App) VerifyBlock(block *types.Block) bool { } // BlockConfirmed implements Application interface. -func (app *App) BlockConfirmed(_ common.Hash) { +func (app *App) BlockConfirmed(_ types.Block) { } // StronglyAcked implements Application interface. @@ -145,15 +145,16 @@ func (app *App) TotalOrderingDelivered(blockHashes common.Hashes, early bool) { } // BlockDelivered implements Application interface. -func (app *App) BlockDelivered(block types.Block) { +func (app *App) BlockDelivered( + blockHash common.Hash, result types.FinalizationResult) { app.deliveredLock.Lock() defer app.deliveredLock.Unlock() - app.Delivered[block.Hash] = &AppDeliveredRecord{ - ConsensusTime: block.ConsensusTimestamp, + app.Delivered[blockHash] = &AppDeliveredRecord{ + ConsensusTime: result.Timestamp, When: time.Now().UTC(), } - app.DeliverSequence = append(app.DeliverSequence, block.Hash) + app.DeliverSequence = append(app.DeliverSequence, blockHash) } // Compare performs these checks against another App instance |