Merge branch 'master' into feature/folder-saver

This commit is contained in:
Ben 2024-11-26 12:27:47 +01:00
commit c2df15436f
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
8 changed files with 21 additions and 16 deletions

View File

@ -15,12 +15,13 @@
To = from; To = from;
} }
TimeRange = timeRange; TimeRange = timeRange;
NumberOfBlocks = (To - From) + 1;
} }
public ulong From { get; } public ulong From { get; }
public ulong To { get; } public ulong To { get; }
public TimeRange TimeRange { get; } public TimeRange TimeRange { get; }
public ulong NumberOfBlocks => To - From; public ulong NumberOfBlocks { get; }
public override string ToString() public override string ToString()
{ {

View File

@ -75,11 +75,12 @@ namespace CodexContractsPlugin.ChainMonitor
throw new Exception(msg); throw new Exception(msg);
} }
log.Log($"ChainState updating: {events.BlockInterval}"); log.Log($"ChainState updating: {events.BlockInterval} = {events.All.Length} events.");
// Run through each block and apply the events to the state in order. // Run through each block and apply the events to the state in order.
var span = events.BlockInterval.TimeRange.Duration; var span = events.BlockInterval.TimeRange.Duration;
var numBlocks = events.BlockInterval.NumberOfBlocks; var numBlocks = events.BlockInterval.NumberOfBlocks;
if (numBlocks == 0) return;
var spanPerBlock = span / numBlocks; var spanPerBlock = span / numBlocks;
var eventUtc = events.BlockInterval.TimeRange.From; var eventUtc = events.BlockInterval.TimeRange.From;

File diff suppressed because one or more lines are too long

View File

@ -10,7 +10,7 @@ namespace CodexPlugin
public class ApiChecker public class ApiChecker
{ {
// <INSERT-OPENAPI-YAML-HASH> // <INSERT-OPENAPI-YAML-HASH>
private const string OpenApiYamlHash = "09-53-C3-A6-31-A5-0C-8B-53-1C-3D-C7-2B-1E-85-C7-17-60-54-43-01-C4-49-4E-D9-68-35-7D-F7-41-13-B5"; private const string OpenApiYamlHash = "34-B5-DA-26-40-76-B8-D8-8E-7D-9C-17-85-C6-B0-63-55-8D-C6-01-0B-96-BB-7C-BD-53-E5-32-07-ED-29-92";
private const string OpenApiFilePath = "/codex/openapi.yaml"; private const string OpenApiFilePath = "/codex/openapi.yaml";
private const string DisableEnvironmentVariable = "CODEXPLUGIN_DISABLE_APICHECK"; private const string DisableEnvironmentVariable = "CODEXPLUGIN_DISABLE_APICHECK";

View File

@ -109,7 +109,7 @@ namespace CodexPlugin
// Custom scripting in the Codex test image will write this variable to a private-key file, // Custom scripting in the Codex test image will write this variable to a private-key file,
// and pass the correct filename to Codex. // and pass the correct filename to Codex.
var account = marketplaceSetup.EthAccountSetup.GetNew(); var account = marketplaceSetup.EthAccountSetup.GetNew();
AddEnvVar("PRIV_KEY", account.PrivateKey); AddEnvVar("ETH_PRIVATE_KEY", account.PrivateKey);
Additional(account); Additional(account);
SetCommandOverride(marketplaceSetup); SetCommandOverride(marketplaceSetup);

View File

@ -199,8 +199,8 @@ namespace CodexPlugin
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.OriginalBytes)), OriginalBytes = new ByteSize(Convert.ToInt64(manifest.DatasetSize)),
RootHash = manifest.RootHash, RootHash = manifest.TreeCid,
Protected = manifest.Protected Protected = manifest.Protected
}; };
} }

View File

@ -344,10 +344,10 @@ components:
ManifestItem: ManifestItem:
type: object type: object
properties: properties:
rootHash: treeCid:
$ref: "#/components/schemas/Cid" $ref: "#/components/schemas/Cid"
description: "Root hash of the content" description: "Unique data identifier"
originalBytes: datasetSize:
type: integer type: integer
format: int64 format: int64
description: "Length of original content in bytes" description: "Length of original content in bytes"
@ -359,15 +359,18 @@ components:
description: "Indicates if content is protected by erasure-coding" description: "Indicates if content is protected by erasure-coding"
filename: filename:
type: string type: string
nullable: true
description: "The original name of the uploaded content (optional)" description: "The original name of the uploaded content (optional)"
example: codex.png example: codex.png
mimetype: mimetype:
type: string type: string
nullable: true
description: "The original mimetype of the uploaded content (optional)" description: "The original mimetype of the uploaded content (optional)"
example: image/png example: image/png
uploadedAt: uploadedAt:
type: integer type: integer
format: int64 format: int64
nullable: true
description: "The UTC upload timestamp in seconds" description: "The UTC upload timestamp in seconds"
example: 1729244192 example: 1729244192

View File

@ -66,7 +66,7 @@ namespace BiblioTech
success: true, success: true,
title: $"Success: '{content.Cid}'", title: $"Success: '{content.Cid}'",
error: "", error: "",
$"size: {content.Manifest.OriginalBytes} bytes", $"size: {content.Manifest.DatasetSize} bytes",
$"blockSize: {content.Manifest.BlockSize} bytes", $"blockSize: {content.Manifest.BlockSize} bytes",
$"protected: {content.Manifest.Protected}" $"protected: {content.Manifest.Protected}"
); );