diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-10-04 14:56:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-04 14:56:00 +0800 |
commit | 149e918f4fc78632483bf549dd8f5ffe55366e18 (patch) | |
tree | feabcb67103d76cc829ea81a1d57735e71db23d8 /core/test/app.go | |
parent | 519cc8a734a510f44463b8dd175b7505f0308a22 (diff) | |
download | dexon-consensus-149e918f4fc78632483bf549dd8f5ffe55366e18.tar dexon-consensus-149e918f4fc78632483bf549dd8f5ffe55366e18.tar.gz dexon-consensus-149e918f4fc78632483bf549dd8f5ffe55366e18.tar.bz2 dexon-consensus-149e918f4fc78632483bf549dd8f5ffe55366e18.tar.lz dexon-consensus-149e918f4fc78632483bf549dd8f5ffe55366e18.tar.xz dexon-consensus-149e918f4fc78632483bf549dd8f5ffe55366e18.tar.zst dexon-consensus-149e918f4fc78632483bf549dd8f5ffe55366e18.zip |
core: Check Witness height. Add ConsensusTime and ConsensusHeight to block. (#170)
Diffstat (limited to 'core/test/app.go')
-rw-r--r-- | core/test/app.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/core/test/app.go b/core/test/app.go index 3ec670c..bf14d1b 100644 --- a/core/test/app.go +++ b/core/test/app.go @@ -96,9 +96,16 @@ func NewApp() *App { } } -// PrepareBlock implements Application interface. -func (app *App) PrepareBlock(position types.Position) ([]byte, []byte) { - return []byte{}, []byte{} +// PreparePayload implements Application interface. +func (app *App) PreparePayload(position types.Position) []byte { + return []byte{} +} + +// PrepareWitness implements Application interface. +func (app *App) PrepareWitness(height uint64) types.Witness { + return types.Witness{ + Height: height, + } } // VerifyBlock implements Application. @@ -143,7 +150,7 @@ func (app *App) BlockDelivered(block types.Block) { defer app.deliveredLock.Unlock() app.Delivered[block.Hash] = &AppDeliveredRecord{ - ConsensusTime: block.Witness.Timestamp, + ConsensusTime: block.ConsensusTimestamp, When: time.Now().UTC(), } app.DeliverSequence = append(app.DeliverSequence, block.Hash) |