diff --git a/core/types/shard_state.go b/core/types/shard_state.go index a160bb454..4816c47ba 100644 --- a/core/types/shard_state.go +++ b/core/types/shard_state.go @@ -21,6 +21,11 @@ type ShardState []Committee // BlsPublicKey defines the bls public key type BlsPublicKey [96]byte +// Hex returns the hex string of bls public key +func (pk BlsPublicKey) Hex() string { + return hex.EncodeToString(pk[:]) +} + // NodeID represents node id (BLS address). type NodeID struct { EcdsaAddress string @@ -34,11 +39,6 @@ type Committee struct { NodeList []NodeID } -// Hex returns the hex string of bls public key -func (pk BlsPublicKey) Hex() string { - return hex.EncodeToString(pk[:]) -} - // GetHashFromNodeList will sort the list, then use Keccak256 to hash the list // notice that the input nodeList will be modified (sorted) func GetHashFromNodeList(nodeList []NodeID) []byte {