diff options
Diffstat (limited to 'core/test')
-rw-r--r-- | core/test/app.go | 15 | ||||
-rw-r--r-- | core/test/app_test.go | 7 | ||||
-rw-r--r-- | core/test/stopper_test.go | 4 |
3 files changed, 16 insertions, 10 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) diff --git a/core/test/app_test.go b/core/test/app_test.go index baea838..21d4e24 100644 --- a/core/test/app_test.go +++ b/core/test/app_test.go @@ -81,10 +81,9 @@ func (s *AppTestSuite) deliverBlock( app *App, hash common.Hash, timestamp time.Time) { app.BlockDelivered(types.Block{ - Hash: hash, - Witness: types.Witness{ - Timestamp: timestamp, - }}) + Hash: hash, + ConsensusTimestamp: timestamp, + }) } func (s *AppTestSuite) TestCompare() { diff --git a/core/test/stopper_test.go b/core/test/stopper_test.go index de1c1a5..df207ec 100644 --- a/core/test/stopper_test.go +++ b/core/test/stopper_test.go @@ -62,8 +62,8 @@ func (s *StopperTestSuite) TestStopByConfirmedBlocks() { app.TotalOrderingDelivered(hashes, false) for _, h := range hashes { app.BlockDelivered(types.Block{ - Hash: h, - Witness: types.Witness{Timestamp: time.Time{}}}) + Hash: h, + ConsensusTimestamp: time.Time{}}) } } } |