-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2160 from greymistcube/bump/libplanet-to-3.4.0
⬆️ Bump libplanet to 3.4.0
- Loading branch information
Showing
13 changed files
with
77 additions
and
73 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
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
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
Submodule .Libplanet
updated
57 files
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Buffers; | ||
using System.Security.Cryptography; | ||
using Libplanet.Common; | ||
using MessagePack; | ||
using MessagePack.Formatters; | ||
|
||
namespace Lib9c.Formatters | ||
{ | ||
public class HashDigestFormatter : IMessagePackFormatter<HashDigest<SHA256>> | ||
{ | ||
public void Serialize( | ||
ref MessagePackWriter writer, | ||
HashDigest<SHA256> value, | ||
MessagePackSerializerOptions options) | ||
{ | ||
writer.Write(value.ToByteArray()); | ||
} | ||
|
||
public HashDigest<SHA256> Deserialize( | ||
ref MessagePackReader reader, | ||
MessagePackSerializerOptions options) | ||
{ | ||
options.Security.DepthStep(ref reader); | ||
|
||
var bytes = reader.ReadBytes()?.ToArray(); | ||
if (bytes is null) | ||
{ | ||
throw new InvalidOperationException(); | ||
} | ||
|
||
return new HashDigest<SHA256>(bytes); | ||
} | ||
} | ||
} |
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