aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/dexon-foundation/dexon-consensus/core/types
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-11-20 13:51:27 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:18 +0800
commit194c8fdc922b4173cf433e8f92711459b97c3ab0 (patch)
tree337ebd9c4a22cec51e32d6f03d15988156ad137b /vendor/github.com/dexon-foundation/dexon-consensus/core/types
parentd035ac7c8c624fc884dbc300a2ec7dcaf8dc1905 (diff)
downloadgo-tangerine-194c8fdc922b4173cf433e8f92711459b97c3ab0.tar
go-tangerine-194c8fdc922b4173cf433e8f92711459b97c3ab0.tar.gz
go-tangerine-194c8fdc922b4173cf433e8f92711459b97c3ab0.tar.bz2
go-tangerine-194c8fdc922b4173cf433e8f92711459b97c3ab0.tar.lz
go-tangerine-194c8fdc922b4173cf433e8f92711459b97c3ab0.tar.xz
go-tangerine-194c8fdc922b4173cf433e8f92711459b97c3ab0.tar.zst
go-tangerine-194c8fdc922b4173cf433e8f92711459b97c3ab0.zip
vendor: sync to latest core (#37)
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/types')
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/core/types/block-randomness.go4
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/core/types/block.go2
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go8
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/core/types/position.go3
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/core/types/vote.go3
5 files changed, 11 insertions, 9 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/block-randomness.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/block-randomness.go
index 1eaa3e398..6df245b08 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/block-randomness.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/block-randomness.go
@@ -31,8 +31,8 @@ type AgreementResult struct {
}
func (r *AgreementResult) String() string {
- return fmt.Sprintf(
- "agreementResult[%s:%s]", r.BlockHash, &r.Position)
+ return fmt.Sprintf("agreementResult{Hash:%s %s}",
+ r.BlockHash.String()[:6], &r.Position)
}
// BlockRandomnessResult describes a block randomness result
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/block.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/block.go
index b24e1f715..f42b70267 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/block.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/block.go
@@ -221,7 +221,7 @@ func (b *Block) DecodeRLP(s *rlp.Stream) error {
}
func (b *Block) String() string {
- return fmt.Sprintf("Block(%v:%s)", b.Hash.String()[:6], &b.Position)
+ return fmt.Sprintf("Block{Hash:%v %s}", b.Hash.String()[:6], &b.Position)
}
// Clone returns a deep copy of a block.
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go
index 4053c5a28..cecc4f16c 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go
@@ -61,7 +61,7 @@ type MasterPublicKey struct {
}
func (d *MasterPublicKey) String() string {
- return fmt.Sprintf("MasterPublicKey[%s:%d]",
+ return fmt.Sprintf("MasterPublicKey{KP:%s Round:%d}",
d.ProposerID.String()[:6],
d.Round)
}
@@ -141,11 +141,11 @@ type Complaint struct {
func (c *Complaint) String() string {
if c.IsNack() {
- return fmt.Sprintf("DKGNackComplaint[%s:%d]%s",
+ return fmt.Sprintf("DKGNackComplaint{CP:%s Round:%d PSP:%s}",
c.ProposerID.String()[:6], c.Round,
c.PrivateShare.ProposerID.String()[:6])
}
- return fmt.Sprintf("Complaint[%s:%d]%v",
+ return fmt.Sprintf("DKGComplaint{CP:%s Round:%d PrivateShare:%v}",
c.ProposerID.String()[:6], c.Round, c.PrivateShare)
}
@@ -175,7 +175,7 @@ type Finalize struct {
}
func (final *Finalize) String() string {
- return fmt.Sprintf("DKGFinal[%s:%d]",
+ return fmt.Sprintf("DKGFinal{FP:%s Round:%d}",
final.ProposerID.String()[:6],
final.Round)
}
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/position.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/position.go
index 1fc7e6bf4..8822f6ea9 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/position.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/position.go
@@ -29,7 +29,8 @@ type Position struct {
}
func (pos *Position) String() string {
- return fmt.Sprintf("[%d:%d:%d]", pos.Round, pos.ChainID, pos.Height)
+ return fmt.Sprintf("Position{Round:%d Chain:%d Height:%d}",
+ pos.Round, pos.ChainID, pos.Height)
}
// Equal checks if two positions are equal, it panics when their chainIDs
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/vote.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/vote.go
index 12c3af892..7601542ae 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/vote.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/vote.go
@@ -52,7 +52,8 @@ type Vote struct {
}
func (v *Vote) String() string {
- return fmt.Sprintf("Vote[%s:%s](%d:%d):%s", v.ProposerID.String()[:6],
+ return fmt.Sprintf("Vote{BP:%s %s Period:%d Type:%d Hash:%s}",
+ v.ProposerID.String()[:6],
&v.Position, v.Period, v.Type, v.BlockHash.String()[:6])
}