From 48d6d76d180011d2f1a06fbb03b2d8aa2a53c0c2 Mon Sep 17 00:00:00 2001 From: atvanguard <93arpit@gmail.com> Date: Tue, 21 Apr 2020 10:29:59 +0530 Subject: [PATCH] minor: Remove the redundant validator.Bytes() func, fix comments (2.26) --- consensus/bor/validator.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/consensus/bor/validator.go b/consensus/bor/validator.go index 0592ab3b13..1d12666138 100644 --- a/consensus/bor/validator.go +++ b/consensus/bor/validator.go @@ -2,7 +2,7 @@ package bor import ( "bytes" - "encoding/json" + // "encoding/json" "errors" "fmt" "math/big" @@ -13,8 +13,6 @@ import ( ) // Validator represets Volatile state for each Validator -// NOTE: The ProposerPriority is not included in Validator.Hash(); -// make sure to update that method if changes are made here type Validator struct { ID uint64 `json:"ID"` Address common.Address `json:"signer"` @@ -80,18 +78,6 @@ func ValidatorListString(vals []*Validator) string { return strings.Join(chunks, ",") } -// Bytes computes the unique encoding of a validator with a given voting power. -// These are the bytes that gets hashed in consensus. It excludes address -// as its redundant with the pubkey. This also excludes ProposerPriority -// which changes every round. -func (v *Validator) Bytes() []byte { - b, err := json.Marshal(v) - if err != nil { - return b - } - return nil -} - // HeaderBytes return header bytes func (v *Validator) HeaderBytes() []byte { result := make([]byte, 40)