예제 #1
0
func decodeBucketNumber(encodedBytes []byte) (int, int) {
	bucketNum, bytesConsumed := util.DecodeOrderPreservingVarUint64(encodedBytes)
	return int(bucketNum), bytesConsumed
}
예제 #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
}