aboutsummaryrefslogtreecommitdiffstats
path: root/core/nonblocking_test.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2019-04-01 12:25:09 +0800
committerJimmy Hu <jimmy.hu@dexon.org>2019-04-01 12:25:09 +0800
commitecc5e12b1ac4826e302607769f5b831ab4c27046 (patch)
treee01fbf5d796c555f1d343e14023c282ad83bcba8 /core/nonblocking_test.go
parent46f00c345dc0993cf888523e482ae0ff385c4391 (diff)
downloaddexon-consensus-ecc5e12b1ac4826e302607769f5b831ab4c27046.tar
dexon-consensus-ecc5e12b1ac4826e302607769f5b831ab4c27046.tar.gz
dexon-consensus-ecc5e12b1ac4826e302607769f5b831ab4c27046.tar.bz2
dexon-consensus-ecc5e12b1ac4826e302607769f5b831ab4c27046.tar.lz
dexon-consensus-ecc5e12b1ac4826e302607769f5b831ab4c27046.tar.xz
dexon-consensus-ecc5e12b1ac4826e302607769f5b831ab4c27046.tar.zst
dexon-consensus-ecc5e12b1ac4826e302607769f5b831ab4c27046.zip
core: clean TODOs (#539)
* core: fix block timestamp (#529) * Remove TODO dMoment is still required when the block timestamp of the genesis block is still need to be verified. * Refine timestamp when preparing blocks * Add timestamp checking in sanity check * Revert code to patch position when preparing * Remove TODOs that seems meaningless now * Remove TODOs related to refactoring * core: remove finalization (#531) - Remove types.FinalizationResult, randomness field would be moved to `types.Block` directly. - Add a placeholder for types.Block.Randomness field for blocks proposed from round < DKGDelayRound. (refer to core.NoRand) - Make the height of the genesis block starts from 1. (refer to types.GenesisHeight) - The fullnode's behavior of core.Governance.GetRoundHeight is (assume round-length is 100): - round: 0 -> 0 (we need to workaround this) - round: 1 -> 101 - round: 2 -> 201 - test.Governance already simulate this behavior, and the workaround is wrapped at utils.GetRoundHeight. * core: fix issues (#536) fixing code in these condition: - assigning position without initializing them and expected it's for genesis - compare height with 0
Diffstat (limited to 'core/nonblocking_test.go')
-rw-r--r--core/nonblocking_test.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/nonblocking_test.go b/core/nonblocking_test.go
index 110433a..4816186 100644
--- a/core/nonblocking_test.go
+++ b/core/nonblocking_test.go
@@ -60,7 +60,7 @@ func (app *slowApp) BlockConfirmed(block types.Block) {
}
func (app *slowApp) BlockDelivered(blockHash common.Hash,
- blockPosition types.Position, _ types.FinalizationResult) {
+ blockPosition types.Position, _ []byte) {
time.Sleep(app.sleep)
app.blockDelivered[blockHash] = struct{}{}
}
@@ -100,7 +100,7 @@ func (app *noDebugApp) BlockConfirmed(block types.Block) {
}
func (app *noDebugApp) BlockDelivered(blockHash common.Hash,
- blockPosition types.Position, _ types.FinalizationResult) {
+ blockPosition types.Position, _ []byte) {
app.blockDelivered[blockHash] = struct{}{}
}
@@ -125,8 +125,7 @@ func (s *NonBlockingTestSuite) TestNonBlocking() {
Hash: hash,
Witness: types.Witness{},
})
- nbModule.BlockDelivered(
- hash, types.Position{}, types.FinalizationResult{})
+ nbModule.BlockDelivered(hash, types.Position{}, []byte(nil))
}
// nonBlocking should be non-blocking.
@@ -146,7 +145,7 @@ func (s *NonBlockingTestSuite) TestNoDebug() {
// Test BlockConfirmed.
nbModule.BlockConfirmed(types.Block{Hash: hash})
// Test BlockDelivered
- nbModule.BlockDelivered(hash, types.Position{}, types.FinalizationResult{})
+ nbModule.BlockDelivered(hash, types.Position{}, []byte(nil))
nbModule.wait()
s.Contains(app.blockConfirmed, hash)
s.Contains(app.blockDelivered, hash)