aboutsummaryrefslogtreecommitdiffstats
path: root/core/interfaces.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-09-25 14:10:16 +0800
committerWei-Ning Huang <aitjcize@gmail.com>2018-09-25 14:10:16 +0800
commit6c8d26d2e797e8420fc3de4b15e4c556f968aba0 (patch)
tree22beecc01da7a9ce5cac36135a89010d6d4ed4f2 /core/interfaces.go
parentca935bdbac190766f29fb73433a82ee5806bc8f9 (diff)
downloadtangerine-consensus-6c8d26d2e797e8420fc3de4b15e4c556f968aba0.tar
tangerine-consensus-6c8d26d2e797e8420fc3de4b15e4c556f968aba0.tar.gz
tangerine-consensus-6c8d26d2e797e8420fc3de4b15e4c556f968aba0.tar.bz2
tangerine-consensus-6c8d26d2e797e8420fc3de4b15e4c556f968aba0.tar.lz
tangerine-consensus-6c8d26d2e797e8420fc3de4b15e4c556f968aba0.tar.xz
tangerine-consensus-6c8d26d2e797e8420fc3de4b15e4c556f968aba0.tar.zst
tangerine-consensus-6c8d26d2e797e8420fc3de4b15e4c556f968aba0.zip
core: add debug (#133)
* Split interface * Rename nonblocking-application to nonblocking Parts needs nonblocking gets more. * Implement core.nonBlocking based on interface split * Fix: the witness parent hash could be parent on compaction chain. * Rename Application.DeliverBlock to BlockDeliver To sync with naming of other methods. * Change methods' fingerprint - BlockConfirmed provides block hash only. - BlockDeliver provde a whole block.
Diffstat (limited to 'core/interfaces.go')
-rw-r--r--core/interfaces.go26
1 files changed, 15 insertions, 11 deletions
diff --git a/core/interfaces.go b/core/interfaces.go
index 5e1002c..03caa63 100644
--- a/core/interfaces.go
+++ b/core/interfaces.go
@@ -33,8 +33,22 @@ type Application interface {
// VerifyPayloads verifies if the payloads are valid.
VerifyPayloads(payloads []byte) bool
+ // BlockDeliver is called when a block is add to the compaction chain.
+ BlockDeliver(block types.Block)
+
+ // BlockProcessedChan returns a channel to receive the block hashes that have
+ // finished processing by the application.
+ BlockProcessedChan() <-chan types.WitnessResult
+
+ // WitnessAckDeliver is called when a witness ack is created.
+ WitnessAckDeliver(witnessAck *types.WitnessAck)
+}
+
+// Debug describes the application interface that requires
+// more detailed consensus execution.
+type Debug interface {
// BlockConfirmed is called when a block is confirmed and added to lattice.
- BlockConfirmed(block *types.Block)
+ BlockConfirmed(blockHash common.Hash)
// StronglyAcked is called when a block is strongly acked.
StronglyAcked(blockHash common.Hash)
@@ -42,16 +56,6 @@ type Application interface {
// TotalOrderingDeliver is called when the total ordering algorithm deliver
// a set of block.
TotalOrderingDeliver(blockHashes common.Hashes, early bool)
-
- // DeliverBlock is called when a block is add to the compaction chain.
- DeliverBlock(blockHash common.Hash, timestamp time.Time)
-
- // BlockProcessedChan returns a channel to receive the block hashes that have
- // finished processing by the application.
- BlockProcessedChan() <-chan types.WitnessResult
-
- // WitnessAckDeliver is called when a witness ack is created.
- WitnessAckDeliver(witnessAck *types.WitnessAck)
}
// Network describs the network interface that interacts with DEXON consensus