Ejemplo n.º 1
0
func getLinkedListHead(obj *monkstate.StateObject, base []byte) ([]byte, []byte) {
	headLocLoc := append(base[:len(base)-1], byte(StdVarSize+1))
	headLoc := obj.GetStorage(monkutil.BigD(headLocLoc))
	headKey := headLoc.Bytes()[9:29]
	head := obj.GetStorage(headLoc.BigInt())
	return headKey, head.Bytes()
}
Ejemplo n.º 2
0
func getLinkedListLength(obj *monkstate.StateObject, base []byte) int {
	nEleLoc := append(base[:len(base)-1], byte(StdVarSize+3))
	nEl := obj.GetStorage(monkutil.BigD(nEleLoc))
	return int(nEl.Uint())
}