Skip to main content

ResQ.Storage.PinataClient

PinataClient.MockUploadAsync(Stream, string, string, Dictionary<string,string>) Method

Generates a mock upload result with a fake CID for testing purposes.
private System.Threading.Tasks.Task<ResQ.Storage.UploadResult> MockUploadAsync(System.IO.Stream content, string fileName, string contentType, System.Collections.Generic.Dictionary<string,string>? metadata);

Parameters

content System.IO.Stream The content stream to hash. fileName System.String The filename. contentType System.String The content type. metadata System.Collections.Generic.Dictionary<System.String,System.String> Optional metadata.

Returns

System.Threading.Tasks.Task<UploadResult>
A mock UploadResult with a generated CID.

Remarks

The CID is generated by computing the SHA256 hash of the content and formatting it as a base58-style string starting with “Qm”. This provides deterministic CIDs for the same content while maintaining the appearance of real IPFS CIDs.