-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Breaking] Inherited breaking changes from IpfsShipyard.Ipfs.Core 0.2.0. IDataBlock.DataStream was removed. This pattern encouraged async calls behind synchronous property getters, which is a bad practice and can cause deadlocks. Call the async methods directly on the API instead. The obsolete IFileSystemApi.ListFileAsync was removed due to prior deprecation and removal in Kubo 0.26.0. Use IFileSystemApi.ListAsync and MfsApi.StatAsync instead. [New] Added missing IFileSystemApi.ListAsync. Doesn't fully replace the removed IFileSystemApi.ListFileAsync, but is a step in the right direction. See also ipfs-shipyard/net-ipfs-core#29
- Loading branch information
1 parent
b9b71c4
commit 78a6b9f
Showing
7 changed files
with
58 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,23 @@ | ||
using System.IO; | ||
using System.Runtime.Serialization; | ||
using System.Runtime.Serialization; | ||
|
||
namespace Ipfs.Http | ||
{ | ||
/// <inheritdoc /> | ||
[DataContract] | ||
public class Block : IDataBlock | ||
Check failure on line 7 in src/Block.cs GitHub Actions / build-and-test
Check failure on line 7 in src/Block.cs GitHub Actions / build-and-test
|
||
{ | ||
long? size; | ||
|
||
/// <inheritdoc /> | ||
[DataMember] | ||
public Cid Id { get; set; } | ||
/// <summary> | ||
/// The data of the block. | ||
/// </summary> | ||
public byte[] DataBytes { get; set; } | ||
|
||
/// <inheritdoc /> | ||
[DataMember] | ||
public byte[] DataBytes { get; set; } | ||
public required Cid Id { get; set; } | ||
Check failure on line 16 in src/Block.cs GitHub Actions / build-and-test
|
||
|
||
/// <inheritdoc /> | ||
public Stream DataStream | ||
{ | ||
get | ||
{ | ||
return new MemoryStream(DataBytes, false); | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
[DataMember] | ||
public long Size | ||
{ | ||
get | ||
{ | ||
if (size.HasValue) | ||
{ | ||
return size.Value; | ||
} | ||
return DataBytes.Length; | ||
} | ||
set | ||
{ | ||
size = value; | ||
} | ||
} | ||
|
||
public required long Size { get; set; } | ||
Check failure on line 20 in src/Block.cs GitHub Actions / build-and-test
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.