Skip to content
Permalink
Browse files

Reflect suggestions on the review

  • Loading branch information...
Unengine committed Sep 10, 2019
1 parent 65c1e50 commit 212d34b2fb7021e30a65d0ee65c07d6752a93e1d
Showing with 7 additions and 8 deletions.
  1. +6 −0 CHANGES.md
  2. +0 −8 Libplanet/Action/ActionContext.cs
  3. +1 −0 Libplanet/Action/RandomExtension.cs
@@ -58,6 +58,8 @@ To be released.
`Swarm<T>.BootstrapAsync()` method instead. [[#353]]
- `Peer` with endpoints should be typed as `BoundPeer` which is inherited from
`Peer`. [[#353]]
- Removed `IActionContext.NewGuid()` method. To get a randomly generated [Guid][Guid],
use `RandomExtension.GenerateRandomGuid()` instead. [[#508]]

### Added interfaces

@@ -71,6 +73,8 @@ To be released.
both a `Block<T>.Hash` and a `Transaction<T>.Id`, so that signers cannot
predict the order of transactions in a block before it's mined.
[[#244], [#355]]
- Added `RandomExtension.GenerateRandomGuid()` method that generates a random
[Guid][Guid]. [[#508]]

### Behavioral changes

@@ -111,7 +115,9 @@ To be released.
[#486]: https://github.com/planetarium/libplanet/pull/486
[#498]: https://github.com/planetarium/libplanet/pull/498
[#496]: https://github.com/planetarium/libplanet/pull/496
[#508]: https://github.com/planetarium/libplanet/pull/508
[Kademlia]: https://en.wikipedia.org/wiki/Kademlia
[Guid]: https://docs.microsoft.com/ko-kr/dotnet/api/system.guid?view=netframework-4.8


Version 0.5.3
@@ -32,13 +32,5 @@ internal class ActionContext : IActionContext
public IAccountStateDelta PreviousStates { get; }

public IRandom Random { get; }

public Guid NewGuid()
{
// FIXME implement rfc4122 https://www.ietf.org/rfc/rfc4122.txt
var b = new byte[16];
Random.NextBytes(b);
return new Guid(b);
}
}
}
@@ -18,6 +18,7 @@ public static class RandomExtension
/// <seealso cref="IRandom"/>
public static Guid GenerateRandomGuid(this IRandom random)
{
// FIXME implement rfc4122 https://www.ietf.org/rfc/rfc4122.txt
var bytes = new byte[16];
random.NextBytes(bytes);
return new Guid(bytes);

0 comments on commit 212d34b

Please sign in to comment.
You can’t perform that action at this time.