mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-12 06:53:46 +00:00
minor: Remove the redundant validator.Bytes() func, fix comments (2.26)
This commit is contained in:
parent
b00299ca13
commit
48d6d76d18
1 changed files with 1 additions and 15 deletions
|
|
@ -2,7 +2,7 @@ package bor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
// "encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
@ -13,8 +13,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Validator represets Volatile state for each Validator
|
// 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 {
|
type Validator struct {
|
||||||
ID uint64 `json:"ID"`
|
ID uint64 `json:"ID"`
|
||||||
Address common.Address `json:"signer"`
|
Address common.Address `json:"signer"`
|
||||||
|
|
@ -80,18 +78,6 @@ func ValidatorListString(vals []*Validator) string {
|
||||||
return strings.Join(chunks, ",")
|
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
|
// HeaderBytes return header bytes
|
||||||
func (v *Validator) HeaderBytes() []byte {
|
func (v *Validator) HeaderBytes() []byte {
|
||||||
result := make([]byte, 40)
|
result := make([]byte, 40)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue