Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ShardList = generateShardList()
ShardList is the list of shard index.
Functions ¶
func GetShardIDByPublicHash ¶
func GetShardIDByPublicHash(pkHash *multivacaddress.PublicKeyHash) uint32
GetShardIDByPublicHash function has been deprecated, so don't use it in the future.
func IndexToString ¶
IndexToString convert the shard index to string type.
func IsValidShardID ¶
IsValidShardID returns whether or not the id is within the valid shard id range.
Types ¶
type Index ¶
type Index uint32
Index is the index of shard.
func GetShardIndexByPublicHash ¶
func GetShardIndexByPublicHash(pkHash *multivacaddress.PublicKeyHash) Index
GetShardIndexByPublicHash function has been deprecated, so don't use it in the future.
func IDToShardIndex ¶
IDToShardIndex returns a MultiVAC Index format from a given number in the supported shard range.
func (Index) MarshalJSON ¶
MarshalJSON serialization the data to byte slice and then keep it to json.
func (*Index) UnmarshalJSON ¶
UnmarshalJSON deserialization the json data to origin data.
type IndexAndHeight ¶
IndexAndHeight combines the index and height.
func NewShardIndexAndHeight ¶
func NewShardIndexAndHeight(shard Index, hgt int64) IndexAndHeight
NewShardIndexAndHeight returns a IndexAndHeight.
func (IndexAndHeight) String ¶
func (s IndexAndHeight) String() string
String returns the format string for IndexAndHeight.