Commit f50447a9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f37de13c
......@@ -23,6 +23,7 @@ package main
import (
//"context"
"fmt"
"reflect"
"lab.nexedi.com/kirr/neo/go/zodb"
......@@ -51,7 +52,7 @@ func (zb *zBlk0State) DropState() {
func (zb *zBlk0State) PySetState(pystate interface{}) error {
blkdata, ok := pystate.(string)
if !ok {
// XXX
return fmt.Errorf("expect str; got %T", pystate)
}
zb.blkdata = blkdata
......@@ -76,7 +77,7 @@ func (zd *zDataState) DropState() {
func (zd *zDataState) PySetState(pystate interface{}) error {
data, ok := pystate.(string)
if !ok {
// XXX
return fmt.Errorf("expect str; got %T", pystate)
}
zd.data = data
......@@ -99,7 +100,7 @@ func (zb *zBlk1State) DropState() {
func (zb *zBlk1State) PySetState(pystate interface{}) error {
chunktab, ok := pystate.(*btree.BTree)
if !ok {
// XXX
return fmt.Errorf("expect BTree; got %T", pystate)
}
zb.chunktab = chunktab
......@@ -135,18 +136,21 @@ func (bf *zBigFileState) PySetState(pystate interface{}) (err error) {
// state: (.blksize, .blktab)
t, ok := pystate.(pickle.Tuple)
if !ok || len(t) != 2 {
// XXX
if !ok {
return fmt.Errorf("expect [2](); got %T", pystate)
}
if len(t) != 2 {
return fmt.Errorf("expect [2](); got [%d]()", len(t))
}
// blksize, ok := pickletools.Xint64(t[0]) // XXX reenable (pickletools)
if !ok {
// XXX
return fmt.Errorf("blksize: expect integer; got %T", t[0])
}
blktab, ok := t[1].(*btree.BTree)
if !ok {
// XXX
return fmt.Errorf("blktab: expect BTree; got %T", t[1])
}
bf.blksize = 0 // XXX blksize
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment