Libplanet 0.43.0
Released on October 14, 2022.
Since 0.43.0, we officially provide @planetarium/tx, an npm package for creating unsigned transactions in JavaScript/TypeScript. Although it is still in experimental stage, which can build only unsigned transactions with a system action, its features will be added more in the future.
Backward-incompatible API changes
- Removed
DateTimeOffset?
type parameter that allowed a creation of a genesisBlock<T>
with specific timestamp fromBlockChain<T>.MakeGenesisBlock()
. [#2321] - Overhauled constructors for
BlockMetadata
,BlockContent<T>
,PreEvaluationBlockHeader
,PreEvaluationBlock<T>
,BlockHeader
, andBlock<T>
. [#2321]- All unsafe constructors have been removed in order to prevent instantiation of invalid block related objects.
BlockMetadata
has constructorsBlockMetadata(IBlockMetadata)
andBlockMetadata(long, DateTimeOffset, PublicKey, long, BigInteger, BlockHash?, HashDigest<SHA256>)
.BlockContent
has constructorsBlockContent<T>(IBlockMetadata, IEnumerable<Transaction<T>> transactions)
,BlockContent<T>(BlockMetadata)
andBlockContent<T>(BlockMetadata, IEnumerable<Trnasaction<T>> transactions)
.PreEvaluationBlockHeader
has constructorsPreEvaluationBlockHeader(IPreEvaluationBlockHeader)
andPreEvaluationBlockHeader(BlockMetadata, (Nonce, ImmutableArray<byte>))
.PreEvaluationBlock<T>
has constructorsPreEvaluationBlock<T>(IPreEvaluationBlockHeader, IEnumerable<Transaction<T>>)
andPreEvaluatoinBlock<T>(BlockContent<T>, (Nonce, ImmutableArray<byte>))
.BlockHeader
has constructorsBlockHeader(IBlockHeader)
andBlockHeader(PreEvaluationBlockHeader, (HashDigest<SHA256>, ImmutableArray<byte>?, BlockHash))
.Block<T>
has constructorsBlock<T>(IBlockHeader, IEnumerable<Transaction<T>>)
andBlock<T>(PreEvaluationBlock<T>, (HashDigest<SHA256>, ImmutableArray<byte>, BlockHash))
.
BlockContent<T>
no longer inheritsBlockMetadata
andPreEvaluationBlock<T>
no longer inheritsPreEvaluationBlockHeader
. [#2321]- Both
BlockMetadata
andBlockContent<T>
are made immutable. Their properties can no longer be assigned to. [#2321] - Copy extension methods for
BlockMetadata
andBlockContent<T>
removed. [#2321] - (Libplanet.Extensions.Cocona) The return type of
Utils.DeserializeHumanReadable<T>()
static method becameT?
(wasT
). [#2322]
Added APIs
- System actions now have methods to check equality. [#2294]
Mint
now implementsIEquatable<Mint>
.Mint
now implementsIEquatable<IAction>
.Transfer
now implementsIEquatable<Transfer>
.Transfer
now implementsIEquatable<IAction>
.
- (Libplanet.Net) Added
IRoutingTable
interface. [#2046, #2229] - (Libplanet.Net)
RoutingTable
now implementsIRoutingTable
interface. [#2046, #2229] - Added
ActionEvaluator<T>.GenerateRandomSeed()
static method. [#2131, #2236] - Each
BlockMetadata
,PreEvaluationBlockHeader
, andBlockHeader
can be accessed from any "larger" type object through properties. [#2321]BlockMetadata
can be accessed throughBlockContent<T>.Metadata
orPreEvaluationBlockHeader.Metadata
.PreEvaluationBlockHeader
can be accessed throughPreEvaluationBlock<T>.Header
orBlockHeader.Header
.BlockHeader
can be accessed thorughBlock<T>.Header
(this has not changed, but only listed here for completeness in narrative).
- (Libplanet.Explorer) Added
updatedStates
,updatedFungibleAssets
,fungibleAssetsDelta
GraphQL fields toTxResultType
. [#2353] - (Libplanet.Explorer) Added
nextNonce
query inTransactionQuery<T>
. [#2356, #2366]
Behavioral changes
- Many types became serialized and deserialized better with
System.Text.Json.JsonSerializer
as they now have their own custom converters. Note that these serializations are unavailable on Unity due to its incomplete reflection support. [#2294, #2322]- An
Address
became represented as a single hexadecimal string in JSON. [#2322] - A
BlockHash
became represented as a single hexadecimal string in JSON. [#2322] - A
Currency
became represented as an object with values in JSON. Note that it contains itsHash
and it throwsJsonException
if a JSON object to deserialize has an inconsistentHash
with other field values. [#2322] - A
FungibleAssetValue
became represented as an object with itsCurrency
object andQuantity
string. [#2322] - A
HashDigest<T>
became represented as a single hexadecimal string in JSON. [#2322] - A
Transaction<T>
became represented as an object with values in JSON. [#2294] - A
TxId
became represented as a single hexadecimal string in JSON. [#2322] - System actions became represented as a Bencodex JSON Representation of their
PlainValue
withtype_id
field. [#2294]
- An
- System actions'
GetHashCode()
andEquals(object)
methods now check value equality (rather than reference equality). [#2294] - A
ValidateAppProtocolVersion
became allow validation of different extra. [#2380]
Bug fixes
- Interface methods
IComparable.CompareTo()
andIComparable<T>.CompareTo()
forAddress
are now accessible. [#2384]
Dependencies
- Added @planetarium/tx npm package. [#2294]
- Now depends on Bencodex.Json 0.7.0-dev.20220923062846. [#2294]
- Upgrade Bencodex from 0.6.0 to 0.7.0-dev.20220923062845. [#2294]
- Upgrade System.Text.Json from 4.7.2 to 6.0.6. [#2322]
CLI tools
- Added
planet tx
subcommand group. [#2294]- Added
planet tx analyze
subcommand. - Added
planet tx help
subcommand.
- Added