aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2019-03-08 14:49:00 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commit351689414ceb55a4fa348c390710cf9400d60411 (patch)
tree0c167c53267991e2f2412462099dfb5022da5eb0 /dex
parent6bf4da3b4a272bf00a5d8965dd0a92792f796b6d (diff)
downloaddexon-351689414ceb55a4fa348c390710cf9400d60411.tar.gz
dexon-351689414ceb55a4fa348c390710cf9400d60411.tar.zst
dexon-351689414ceb55a4fa348c390710cf9400d60411.zip
dex, dex/downloader: remove some TODO comments (#232)
Diffstat (limited to 'dex')
-rw-r--r--dex/downloader/downloader.go1
-rw-r--r--dex/downloader/fakepeer.go3
-rw-r--r--dex/downloader/peer.go1
-rw-r--r--dex/handler.go3
-rw-r--r--dex/protocol_test.go6
5 files changed, 1 insertions, 13 deletions
diff --git a/dex/downloader/downloader.go b/dex/downloader/downloader.go
index 3d3a78e18..e3960ea30 100644
--- a/dex/downloader/downloader.go
+++ b/dex/downloader/downloader.go
@@ -1403,7 +1403,6 @@ func (d *Downloader) processHeaders(origin uint64, pivot uint64, number uint64)
// In case of header only syncing, validate the chunk immediately
if d.mode == FastSync || d.mode == LightSync {
- // TODO(sonic) update the gov state to make TSigVerify correct
// Collect the yet unknown headers to mark them as uncertain
unknown := make([]*types.Header, 0, len(headersWithGovState))
for _, header := range chunk {
diff --git a/dex/downloader/fakepeer.go b/dex/downloader/fakepeer.go
index f4ff9b517..e1c3070d2 100644
--- a/dex/downloader/fakepeer.go
+++ b/dex/downloader/fakepeer.go
@@ -89,7 +89,6 @@ func (p *FakePeer) RequestHeadersByHash(hash common.Hash, amount int, skip int,
}
}
- // TODO(sonic): fix this
var headersWithGovState []*types.HeaderWithGovState
for _, h := range headers {
headersWithGovState = append(headersWithGovState,
@@ -122,7 +121,7 @@ func (p *FakePeer) RequestHeadersByNumber(number uint64, amount int, skip int, r
}
headers = append(headers, origin)
}
- // TODO(sonic): fix this
+
var headersWithGovState []*types.HeaderWithGovState
for _, h := range headers {
headersWithGovState = append(headersWithGovState,
diff --git a/dex/downloader/peer.go b/dex/downloader/peer.go
index e1c6960f1..df8ef0ee9 100644
--- a/dex/downloader/peer.go
+++ b/dex/downloader/peer.go
@@ -103,7 +103,6 @@ func (w *lightPeerWrapper) RequestHeadersByNumber(i uint64, amount int, skip int
return w.peer.RequestHeadersByNumber(i, amount, skip, reverse, withGov)
}
func (w *lightPeerWrapper) RequestGovStateByHash(common.Hash) error {
- // TODO(sonic): support this
panic("RequestGovStateByHash not supported in light client mode sync")
}
func (w *lightPeerWrapper) DownloadBodies([]common.Hash) error {
diff --git a/dex/handler.go b/dex/handler.go
index 5bd615c86..efd0538f4 100644
--- a/dex/handler.go
+++ b/dex/handler.go
@@ -909,7 +909,6 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
}
govState, err := pm.blockchain.GetGovStateByHash(hash)
if err != nil {
- // TODO(sonic): handle this error
panic(err)
}
return p.SendGovState(govState)
@@ -1027,7 +1026,6 @@ func (pm *ProtocolManager) BroadcastAgreementResult(
}
}
- // TODO(sonic): send to some of other nodes (gossip)
for _, peer := range pm.peers.PeersWithoutAgreement(rlpHash(agreement)) {
peer.AsyncSendAgreement(agreement)
}
@@ -1048,7 +1046,6 @@ func (pm *ProtocolManager) BroadcastRandomnessResult(
}
}
- // TODO(sonic): send to some of other nodes (gossip)
for _, peer := range pm.peers.PeersWithoutRandomness(rlpHash(randomness)) {
peer.AsyncSendRandomnesses(randomnesses)
}
diff --git a/dex/protocol_test.go b/dex/protocol_test.go
index fb414613e..22281d0f2 100644
--- a/dex/protocol_test.go
+++ b/dex/protocol_test.go
@@ -569,7 +569,6 @@ func TestRecvDKGPrivateShare(t *testing.T) {
defer pm.Stop()
defer p.close()
- // TODO(sonic): polish this
privkey := dkg.NewPrivateKey()
privateShare := dkgTypes.PrivateShare{
ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}},
@@ -606,7 +605,6 @@ func TestSendDKGPrivateShare(t *testing.T) {
defer pm.Stop()
defer p1.close()
- // TODO(sonic): polish this
privkey := dkg.NewPrivateKey()
privateShare := dkgTypes.PrivateShare{
ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}},
@@ -654,7 +652,6 @@ func TestRecvAgreement(t *testing.T) {
defer pm.Stop()
defer p.close()
- // TODO(sonic): polish this
vote := coreTypes.Vote{
VoteHeader: coreTypes.VoteHeader{
ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}},
@@ -698,7 +695,6 @@ func TestSendAgreement(t *testing.T) {
defer pm.Stop()
defer p.close()
- // TODO(sonic): polish this
vote := coreTypes.Vote{
VoteHeader: coreTypes.VoteHeader{
ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}},
@@ -745,7 +741,6 @@ func TestRecvRandomnesses(t *testing.T) {
defer pm.Stop()
defer p.close()
- // TODO(sonic): polish this
randomness := coreTypes.BlockRandomnessResult{
BlockHash: coreCommon.Hash{8, 8, 8},
Position: coreTypes.Position{
@@ -777,7 +772,6 @@ func TestSendRandomnesses(t *testing.T) {
defer pm.Stop()
defer p.close()
- // TODO(sonic): polish this
randomness := coreTypes.BlockRandomnessResult{
BlockHash: coreCommon.Hash{8, 8, 8},
Position: coreTypes.Position{