add v1 support to the state tree
This commit is contained in:
parent
b8d9d7894f
commit
271ceb968a
@ -125,6 +125,12 @@ func NewStateTree(cst cbor.IpldStore, version actors.Version) (*StateTree, error
|
|||||||
switch version {
|
switch version {
|
||||||
case actors.Version0:
|
case actors.Version0:
|
||||||
// info is undefined
|
// info is undefined
|
||||||
|
case actors.Version1:
|
||||||
|
var err error
|
||||||
|
info, err = cst.Put(context.TODO(), new(types.StateInfo))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return nil, xerrors.Errorf("unsupported state tree version: %d", version)
|
return nil, xerrors.Errorf("unsupported state tree version: %d", version)
|
||||||
}
|
}
|
||||||
@ -159,7 +165,7 @@ func LoadStateTree(cst cbor.IpldStore, c cid.Cid) (*StateTree, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch root.Version {
|
switch root.Version {
|
||||||
case actors.Version0:
|
case actors.Version0, actors.Version1:
|
||||||
// supported
|
// supported
|
||||||
default:
|
default:
|
||||||
return nil, xerrors.Errorf("unsupported state tree version: %d", root.Version)
|
return nil, xerrors.Errorf("unsupported state tree version: %d", root.Version)
|
||||||
|
Loading…
Reference in New Issue
Block a user