aboutsummaryrefslogtreecommitdiffstats
path: root/dex/protocol.go
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2018-10-24 20:49:03 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:18 +0800
commitbfe8dc4f017f1fa3e6e2b0c370f7880ef847a7d4 (patch)
tree998f4e93353cdfd80dd5e5ad365a9b2ec2b78d33 /dex/protocol.go
parent040b67af55cf35a749b551469d31e76899748a7e (diff)
downloadgo-tangerine-bfe8dc4f017f1fa3e6e2b0c370f7880ef847a7d4.tar
go-tangerine-bfe8dc4f017f1fa3e6e2b0c370f7880ef847a7d4.tar.gz
go-tangerine-bfe8dc4f017f1fa3e6e2b0c370f7880ef847a7d4.tar.bz2
go-tangerine-bfe8dc4f017f1fa3e6e2b0c370f7880ef847a7d4.tar.lz
go-tangerine-bfe8dc4f017f1fa3e6e2b0c370f7880ef847a7d4.tar.xz
go-tangerine-bfe8dc4f017f1fa3e6e2b0c370f7880ef847a7d4.tar.zst
go-tangerine-bfe8dc4f017f1fa3e6e2b0c370f7880ef847a7d4.zip
dex: remove useless code
Diffstat (limited to 'dex/protocol.go')
-rw-r--r--dex/protocol.go115
1 files changed, 0 insertions, 115 deletions
diff --git a/dex/protocol.go b/dex/protocol.go
index aabce3bf9..04928d2b2 100644
--- a/dex/protocol.go
+++ b/dex/protocol.go
@@ -243,118 +243,3 @@ func rlpHash(x interface{}) (h common.Hash) {
hw.Sum(h[:0])
return h
}
-
-/*
-type rlpDKGPrivateShare struct {
- ProposerID coreTypes.NodeID
- ReceiverID coreTypes.NodeID
- Round uint64
- PrivateShare []byte
- Signature crypto.Signature
-}
-
-func toRLPDKGPrivateShare(ps *coreTypes.DKGPrivateShare) *rlpDKGPrivateShare {
- return &rlpDKGPrivateShare{
- ProposerID: ps.ProposerID,
- ReceiverID: ps.ReceiverID,
- Round: ps.Round,
- PrivateShare: ps.PrivateShare.Bytes(),
- Signature: ps.Signature,
- }
-}
-
-func fromRLPDKGPrivateShare(rps *rlpDKGPrivateShare) *coreTypes.DKGPrivateShare {
- ps := &coreTypes.DKGPrivateShare{
- ProposerID: rps.ProposerID,
- ReceiverID: rps.ReceiverID,
- Round: rps.Round,
- Signature: rps.Signature,
- }
- ps.PrivateShare.SetBytes(rps.PrivateShare)
- return ps
-}
-
-type rlpWitness struct {
- Timestamp uint64
- Height uint64
- Data []byte
-}
-
-type rlpFinalizeResult struct {
- Randomness []byte
- Timestamp uint64
- Height uint64
-}
-
-type rlpLatticeBlock struct {
- ProposerID coreTypes.NodeID `json:"proposer_id"`
- ParentHash coreCommon.Hash `json:"parent_hash"`
- Hash coreCommon.Hash `json:"hash"`
- Position coreTypes.Position `json:"position"`
- Timestamp uint64 `json:"timestamps"`
- Acks coreCommon.SortedHashes `json:"acks"`
- Payload []byte `json:"payload"`
- Witness rlpWitness
- Finalization rlpFinalizeResult
- Signature crypto.Signature `json:"signature"`
- CRSSignature crypto.Signature `json:"crs_signature"`
-}
-
-func toRLPLatticeBlock(b *coreTypes.Block) *rlpLatticeBlock {
- return &rlpLatticeBlock{
- ProposerID: b.ProposerID,
- ParentHash: b.ParentHash,
- Hash: b.Hash,
- Position: b.Position,
- Timestamp: toMillisecond(b.Timestamp),
- Acks: b.Acks,
- Payload: b.Payload,
- Witness: rlpWitness{
- Timestamp: toMillisecond(b.Witness.Timestamp),
- Height: b.Witness.Height,
- Data: b.Witness.Data,
- },
- Finalization: rlpFinalizeResult{
- Randomness: b.Finalization.Randomness,
- Timestamp: toMillisecond(b.Finalization.Timestamp),
- Height: b.Finalization.Height,
- },
- Signature: b.Signature,
- CRSSignature: b.CRSSignature,
- }
-}
-
-func fromRLPLatticeBlock(rb *rlpLatticeBlock) *coreTypes.Block {
- return &coreTypes.Block{
- ProposerID: rb.ProposerID,
- ParentHash: rb.ParentHash,
- Hash: rb.Hash,
- Position: rb.Position,
- Timestamp: fromMillisecond(rb.Timestamp),
- Acks: rb.Acks,
- Payload: rb.Payload,
- Witness: coreTypes.Witness{
- Timestamp: fromMillisecond(rb.Witness.Timestamp),
- Height: rb.Witness.Height,
- Data: rb.Witness.Data,
- },
- Finalization: coreTypes.FinalizationResult{
- Randomness: rb.Finalization.Randomness,
- Timestamp: fromMillisecond(rb.Finalization.Timestamp),
- Height: rb.Finalization.Height,
- },
- Signature: rb.Signature,
- CRSSignature: rb.CRSSignature,
- }
-}
-
-func fromMillisecond(s uint64) time.Time {
- sec := int64(s / 1000)
- nsec := int64((s % 1000) * 1000000)
- return time.Unix(sec, nsec)
-}
-
-func toMillisecond(t time.Time) uint64 {
- return uint64(t.UnixNano() / 1000000)
-}
-*/