[#7] Client cut internal
This commit is contained in:
parent
545e647d7b
commit
b69d22966f
15 changed files with 216 additions and 36 deletions
|
@ -88,8 +88,8 @@ public static class ObjectHeaderMapper
|
|||
|
||||
if (split.Children != null && split.Children.Any())
|
||||
head.Split.Children.AddRange(split.Children.Select(id => id.ToGrpcMessage()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return head;
|
||||
}
|
||||
|
||||
|
@ -103,15 +103,31 @@ public static class ObjectHeaderMapper
|
|||
_ => throw new ArgumentException($"Unknown ObjectType. Value: '{header.ObjectType}'.")
|
||||
};
|
||||
|
||||
return new ObjectHeader(
|
||||
var model = new ObjectHeader(
|
||||
new ContainerId(Base58.Encode(header.ContainerId.Value.ToByteArray())),
|
||||
objTypeName,
|
||||
header.Attributes.Select(attribute => attribute.ToModel()).ToArray()
|
||||
)
|
||||
{
|
||||
PayloadLength = header.PayloadLength,
|
||||
Version = header.Version.ToModel()
|
||||
Version = header.Version.ToModel(),
|
||||
OwnerId = header.OwnerId.ToModel()
|
||||
};
|
||||
|
||||
if (header.Split != null)
|
||||
{
|
||||
model.Split = new Split(SplitId.CrateFromBinary(header.Split.SplitId.ToByteArray()))
|
||||
{
|
||||
Parent = header.Split.Parent?.ToModel(),
|
||||
ParentHeader = header.Split.ParentHeader?.ToModel(),
|
||||
Previous = header.Split.Previous?.ToModel()
|
||||
};
|
||||
|
||||
if (header.Split.Children.Any())
|
||||
model.Split.Children.AddRange(header.Split.Children.Select(x => x.ToModel()));
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,4 +164,3 @@ public static class SignatureMapper
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue