diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-10-01 18:19:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-01 18:19:52 +0800 |
commit | 9c33b9dc8aa59d414a6697f1e2d036e5581860ee (patch) | |
tree | 74a4a77b5c28fa9a550fe1ba40b5b2efac0e7630 /core/interfaces.go | |
parent | 9b78db7a4744176070bf968d50dbebb191b28b69 (diff) | |
download | tangerine-consensus-9c33b9dc8aa59d414a6697f1e2d036e5581860ee.tar tangerine-consensus-9c33b9dc8aa59d414a6697f1e2d036e5581860ee.tar.gz tangerine-consensus-9c33b9dc8aa59d414a6697f1e2d036e5581860ee.tar.bz2 tangerine-consensus-9c33b9dc8aa59d414a6697f1e2d036e5581860ee.tar.lz tangerine-consensus-9c33b9dc8aa59d414a6697f1e2d036e5581860ee.tar.xz tangerine-consensus-9c33b9dc8aa59d414a6697f1e2d036e5581860ee.tar.zst tangerine-consensus-9c33b9dc8aa59d414a6697f1e2d036e5581860ee.zip |
core: update data model to reflect new model (#157)
Update data model:
1) Remove witness ack.
2) Add round to block.
3) Update governance interface.
Diffstat (limited to 'core/interfaces.go')
-rw-r--r-- | core/interfaces.go | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/core/interfaces.go b/core/interfaces.go index 37adf36..465a3ce 100644 --- a/core/interfaces.go +++ b/core/interfaces.go @@ -28,21 +28,14 @@ import ( // Application describes the application interface that interacts with DEXON // consensus core. type Application interface { - // PreparePayload is called when consensus core is preparing a block. - PreparePayload(position types.Position) []byte + // PrepareBlock is called when consensus core is preparing a block. + PrepareBlock(position types.Position) (payload []byte, witnessData []byte) - // VerifyPayload verifies if the payload is valid. - VerifyPayload(payload []byte) bool + // VerifyBlock verifies if the block is valid. + VerifyBlock(block *types.Block) bool // BlockDelivered is called when a block is add to the compaction chain. BlockDelivered(block types.Block) - - // BlockProcessedChan returns a channel to receive the block hashes that have - // finished processing by the application. - BlockProcessedChan() <-chan types.WitnessResult - - // WitnessAckDelivered is called when a witness ack is created. - WitnessAckDelivered(witnessAck *types.WitnessAck) } // Debug describes the application interface that requires @@ -68,9 +61,6 @@ type Network interface { // BroadcastBlock broadcasts block to all nodes in DEXON network. BroadcastBlock(block *types.Block) - // BroadcastWitnessAck broadcasts witnessAck to all nodes in DEXON network. - BroadcastWitnessAck(witnessAck *types.WitnessAck) - // SendDKGPrivateShare sends PrivateShare to a DKG participant. SendDKGPrivateShare(pub crypto.PublicKey, prvShare *types.DKGPrivateShare) |