Updates dataset size name

This commit is contained in:
ThatBen 2025-06-09 10:14:30 +02:00
parent 6b2ca648e4
commit 0c74acab11
No known key found for this signature in database
GPG Key ID: 62C543548433D43E
6 changed files with 7 additions and 7 deletions

View File

@ -66,7 +66,7 @@ namespace CodexClient
public class Manifest public class Manifest
{ {
public string RootHash { get; set; } = string.Empty; public string RootHash { get; set; } = string.Empty;
public ByteSize OriginalBytes { get; set; } = ByteSize.Zero; public ByteSize DatasetSize { get; set; } = ByteSize.Zero;
public ByteSize BlockSize { get; set; } = ByteSize.Zero; public ByteSize BlockSize { get; set; } = ByteSize.Zero;
public bool Protected { get; set; } public bool Protected { get; set; }
} }

View File

@ -208,7 +208,7 @@ namespace CodexClient
return new Manifest return new Manifest
{ {
BlockSize = new ByteSize(Convert.ToInt64(manifest.BlockSize)), BlockSize = new ByteSize(Convert.ToInt64(manifest.BlockSize)),
OriginalBytes = new ByteSize(Convert.ToInt64(manifest.DatasetSize)), DatasetSize = new ByteSize(Convert.ToInt64(manifest.DatasetSize)),
RootHash = manifest.TreeCid, RootHash = manifest.TreeCid,
Protected = manifest.Protected Protected = manifest.Protected
}; };

View File

@ -33,9 +33,9 @@ namespace CodexReleaseTests.DataTests
var local2 = localFiles.Content.Single(f => f.Cid == cid2); var local2 = localFiles.Content.Single(f => f.Cid == cid2);
Assert.That(local1.Manifest.Protected, Is.False); Assert.That(local1.Manifest.Protected, Is.False);
Assert.That(local1.Manifest.OriginalBytes, Is.EqualTo(size1)); Assert.That(local1.Manifest.DatasetSize, Is.EqualTo(size1));
Assert.That(local2.Manifest.Protected, Is.False); Assert.That(local2.Manifest.Protected, Is.False);
Assert.That(local2.Manifest.OriginalBytes, Is.EqualTo(size2)); Assert.That(local2.Manifest.DatasetSize, Is.EqualTo(size2));
} }
} }
} }

View File

@ -27,7 +27,7 @@ namespace CodexReleaseTests.DataTests
Assert.That(spaceDiff, Is.LessThan(64.KB().SizeInBytes)); Assert.That(spaceDiff, Is.LessThan(64.KB().SizeInBytes));
Assert.That(localDataset.Cid, Is.EqualTo(cid)); Assert.That(localDataset.Cid, Is.EqualTo(cid));
Assert.That(localDataset.Manifest.OriginalBytes.SizeInBytes, Is.EqualTo(file.GetFilesize().SizeInBytes)); Assert.That(localDataset.Manifest.DatasetSize.SizeInBytes, Is.EqualTo(file.GetFilesize().SizeInBytes));
} }
} }
} }

View File

@ -22,7 +22,7 @@ namespace CodexReleaseTests.DataTests
var localDataset = downloader.DownloadStreamlessWait(cid, size); var localDataset = downloader.DownloadStreamlessWait(cid, size);
Assert.That(localDataset.Cid, Is.EqualTo(cid)); Assert.That(localDataset.Cid, Is.EqualTo(cid));
Assert.That(localDataset.Manifest.OriginalBytes.SizeInBytes, Is.EqualTo(file.GetFilesize().SizeInBytes)); Assert.That(localDataset.Manifest.DatasetSize.SizeInBytes, Is.EqualTo(file.GetFilesize().SizeInBytes));
// Stop the uploader node and verify that the downloader has the data. // Stop the uploader node and verify that the downloader has the data.
uploader.Stop(waitTillStopped: true); uploader.Stop(waitTillStopped: true);

View File

@ -163,7 +163,7 @@ namespace BiblioTech.CodexChecking
private bool IsManifestLengthCompatible(ICheckResponseHandler handler, TransferCheck check, Manifest manifest) private bool IsManifestLengthCompatible(ICheckResponseHandler handler, TransferCheck check, Manifest manifest)
{ {
var dataLength = check.UniqueData.Length; var dataLength = check.UniqueData.Length;
var manifestLength = manifest.OriginalBytes.SizeInBytes; var manifestLength = manifest.DatasetSize.SizeInBytes;
Log($"Checking manifest length: dataLength={dataLength},manifestLength={manifestLength}"); Log($"Checking manifest length: dataLength={dataLength},manifestLength={manifestLength}");