diff --git a/CHANGES.md b/CHANGES.md index 59f62451e17..6f6ac8b64d3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -40,6 +40,7 @@ To be released. ### Added APIs - (Libplanet.Action) Added `ValidatorSetAccount` class. [[#3745]] + - (Libplanet.Explorer) Added `WorldState.version` field. [[#3746]] ### Behavioral changes @@ -56,6 +57,7 @@ To be released. [#3741]: https://github.com/planetarium/libplanet/pull/3741 [#3742]: https://github.com/planetarium/libplanet/pull/3742 [#3745]: https://github.com/planetarium/libplanet/pull/3745 +[#3746]: https://github.com/planetarium/libplanet/pull/3746 Version 4.3.0 diff --git a/Libplanet.Explorer.Tests/Queries/StateQueryTest.cs b/Libplanet.Explorer.Tests/Queries/StateQueryTest.cs index a7ed77e9a02..56dcc04e023 100644 --- a/Libplanet.Explorer.Tests/Queries/StateQueryTest.cs +++ b/Libplanet.Explorer.Tests/Queries/StateQueryTest.cs @@ -29,6 +29,7 @@ public async Task World() world(blockHash: ""01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b"") { stateRootHash legacy + version } } ", source: source); @@ -40,6 +41,7 @@ public async Task World() Assert.IsAssignableFrom>(resultDict["world"]); Assert.NotNull(states["stateRootHash"]); Assert.True((bool)states["legacy"]); + Assert.Equal(0, states["version"]); } [Fact] diff --git a/Libplanet.Explorer/GraphTypes/WorldStateType.cs b/Libplanet.Explorer/GraphTypes/WorldStateType.cs index 2773827402a..45b83e81cbb 100644 --- a/Libplanet.Explorer/GraphTypes/WorldStateType.cs +++ b/Libplanet.Explorer/GraphTypes/WorldStateType.cs @@ -25,6 +25,12 @@ public WorldStateType() resolve: context => context.Source.Legacy ); + Field>( + name: "version", + description: "The version of the bakcing data model.", + resolve: context => context.Source.Version + ); + Field>( name: "account", description: