Ejemplo n.º 1
0
func decodeBucketNumber(encodedBytes []byte) (int, int) {
	bucketNum, bytesConsumed := util.DecodeOrderPreservingVarUint64(encodedBytes)
	return int(bucketNum), bytesConsumed
}
Ejemplo n.º 2
0
// NewHeightFromBytes constructs a new instance of Height from serialized bytes
func NewHeightFromBytes(b []byte) (*Height, int) {
	blockNum, n1 := util.DecodeOrderPreservingVarUint64(b)
	txNum, n2 := util.DecodeOrderPreservingVarUint64(b[n1:])
	return NewHeight(blockNum, txNum), n1 + n2
}