diff options
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/types/block-randomness.go')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/types/block-randomness.go | 8 |
1 files changed, 8 insertions, 0 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 1c64d4ad9..65cb635ca 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 @@ -18,6 +18,7 @@ package types import ( + "encoding/hex" "fmt" "github.com/dexon-foundation/dexon-consensus/common" @@ -42,3 +43,10 @@ type BlockRandomnessResult struct { Position Position `json:"position"` Randomness []byte `json:"randomness"` } + +func (r *BlockRandomnessResult) String() string { + return fmt.Sprintf("blockRandomness{Block:%s Pos:%s Rand:%s}", + r.BlockHash.String()[:6], &r.Position, + hex.EncodeToString(r.Randomness)[:6], + ) +} |