fix(lotus-sim): check for slash in names on copy

This commit is contained in:
Steven Allen 2021-06-08 13:42:01 -07:00
parent 8410b0f79f
commit 4f0b9eefc1

View File

@ -180,6 +180,13 @@ func (nd *Node) DeleteSim(ctx context.Context, name string) error {
// CopySim copies a simulation.
func (nd *Node) CopySim(ctx context.Context, oldName, newName string) error {
if strings.Contains(newName, "/") {
return xerrors.Errorf("simulation name %q cannot contain a '/'", newName)
}
if strings.Contains(oldName, "/") {
return xerrors.Errorf("simulation name %q cannot contain a '/'", oldName)
}
values := make(map[string][]byte)
for _, field := range simFields {
key := simulationPrefix.ChildString(field).ChildString(oldName)