aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2019-03-08 14:49:00 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:57 +0800
commitcdef678e25c9c5a2ce8677169235a84aff731ef8 (patch)
treef6bd4494e7791e259e2bb6f9f39ffecd44e54f39
parent107ccba7eb8b86d7f3a46a8346b1cf1633429955 (diff)
downloaddexon-cdef678e25c9c5a2ce8677169235a84aff731ef8.tar
dexon-cdef678e25c9c5a2ce8677169235a84aff731ef8.tar.gz
dexon-cdef678e25c9c5a2ce8677169235a84aff731ef8.tar.bz2
dexon-cdef678e25c9c5a2ce8677169235a84aff731ef8.tar.lz
dexon-cdef678e25c9c5a2ce8677169235a84aff731ef8.tar.xz
dexon-cdef678e25c9c5a2ce8677169235a84aff731ef8.tar.zst
dexon-cdef678e25c9c5a2ce8677169235a84aff731ef8.zip
dex, dex/downloader: remove some TODO comments (#232)
-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{