aboutsummaryrefslogtreecommitdiffstats
path: root/dex/app.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@cobinhood.com>2018-09-21 15:06:38 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:48 +0800
commit4746deb69870907f9a18282b965ced372d1c0e98 (patch)
tree49e79ad34b315e3df8bb7555b4606e7c3e6240a5 /dex/app.go
parentf60070586cf462c2cf2de91911e5b34c8287da51 (diff)
downloaddexon-4746deb69870907f9a18282b965ced372d1c0e98.tar.gz
dexon-4746deb69870907f9a18282b965ced372d1c0e98.tar.zst
dexon-4746deb69870907f9a18282b965ced372d1c0e98.zip
dex: make geth buildable and update interface skeleton
Diffstat (limited to 'dex/app.go')
-rw-r--r--dex/app.go26
1 files changed, 23 insertions, 3 deletions
diff --git a/dex/app.go b/dex/app.go
index 5aa1f6e35..f87f669fb 100644
--- a/dex/app.go
+++ b/dex/app.go
@@ -22,18 +22,32 @@ import (
"github.com/dexon-foundation/dexon-consensus-core/common"
"github.com/dexon-foundation/dexon-consensus-core/core/types"
+
+ "github.com/ethereum/go-ethereum/core"
)
// DexconApp implementes the DEXON consensus core application interface.
type DexconApp struct {
+ txPool *core.TxPool
+
+ witnessResultChan chan types.WitnessResult
+}
+
+func NewDexconApp(txPool *core.TxPool) *DexconApp {
+ return &DexconApp{
+ txPool: txPool,
+ witnessResultChan: make(chan types.WitnessResult),
+ }
}
// PreparePayload is called when consensus core is preparing a block.
-func (d *DexconApp) PreparePayloads(position types.Position) []byte {
+func (d *DexconApp) PreparePayload(position types.Position) []byte {
+ return nil
}
// VerifyPayloads verifies if the payloads are valid.
func (d *DexconApp) VerifyPayloads(payloads []byte) bool {
+ return true
}
// BlockConfirmed is called when a block is confirmed and added to lattice.
@@ -53,6 +67,12 @@ func (d *DexconApp) TotalOrderingDeliver(blockHashes common.Hashes, early bool)
func (d *DexconApp) DeliverBlock(blockHash common.Hash, timestamp time.Time) {
}
-// NotaryAckDeliver is called when a notary ack is created.
-func (d *DexconApp) NotaryAckDeliver(notaryAck *types.NotaryAck) {
+// BlockProcessedChan returns a channel to receive the block hashes that have
+// finished processing by the application.
+func (d *DexconApp) BlockProcessedChan() <-chan types.WitnessResult {
+ return d.witnessResultChan
+}
+
+// WitnessAckDeliver is called when a notary ack is created.
+func (d *DexconApp) WitnessAckDeliver(notaryAck *types.WitnessAck) {
}