From 771567583c5c3033ace854680b82ff119f5e3f66 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Thu, 7 Sep 2023 21:04:43 +0900 Subject: [PATCH 1/3] Bump libplanet to 3.3.0 --- .Libplanet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Libplanet b/.Libplanet index 97b3d2e597..aa72117b88 160000 --- a/.Libplanet +++ b/.Libplanet @@ -1 +1 @@ -Subproject commit 97b3d2e597c067f06b4f45c8a7b8ccb2ac4ae3f3 +Subproject commit aa72117b8887ec9e189cac97cefc3fa77966dd81 From 64a44b71dbfff50d895d0ac7ade24feab66c0586 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Wed, 6 Sep 2023 10:57:45 +0900 Subject: [PATCH 2/3] Accommodate API changes --- .Lib9c.Tests/Action/MockState.cs | 3 +++ .Lib9c.Tests/Action/MockStateDelta.cs | 3 +++ .../AccountStateDelta.cs | 3 +++ .../RemoteActionEvaluator.cs | 2 +- .../RemoteBlockChainStates.cs | 2 +- .../RemoteBlockState.cs | 5 ++++- Lib9c.MessagePack/AccountStateDelta.cs | 3 +++ Lib9c/Action/ActionBaseExtensions.cs | 3 +++ 8 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.Lib9c.Tests/Action/MockState.cs b/.Lib9c.Tests/Action/MockState.cs index 16d71e0c5c..5a1ded150d 100644 --- a/.Lib9c.Tests/Action/MockState.cs +++ b/.Lib9c.Tests/Action/MockState.cs @@ -10,6 +10,7 @@ namespace Lib9c.Tests.Action using Bencodex.Types; using Libplanet.Action.State; using Libplanet.Crypto; + using Libplanet.Store.Trie; using Libplanet.Types.Assets; using Libplanet.Types.Consensus; @@ -79,6 +80,8 @@ private MockState( public static MockState Empty => _empty; + public ITrie Trie => throw new NotSupportedException(); + public IImmutableDictionary States => _states; public IImmutableDictionary<(Address, Currency), BigInteger> Fungibles => _fungibles; diff --git a/.Lib9c.Tests/Action/MockStateDelta.cs b/.Lib9c.Tests/Action/MockStateDelta.cs index dfad94be18..18a0486a25 100644 --- a/.Lib9c.Tests/Action/MockStateDelta.cs +++ b/.Lib9c.Tests/Action/MockStateDelta.cs @@ -12,6 +12,7 @@ namespace Lib9c.Tests.Action using Libplanet.Action; using Libplanet.Action.State; using Libplanet.Crypto; + using Libplanet.Store.Trie; using Libplanet.Types.Assets; using Libplanet.Types.Consensus; @@ -41,6 +42,8 @@ private MockStateDelta(IAccountState baseState, IAccountDelta delta) TotalUpdatedFungibles = ImmutableDictionary<(Address, Currency), BigInteger>.Empty; } + public ITrie Trie => throw new NotSupportedException(); + /// public IAccountDelta Delta { get; private set; } diff --git a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/AccountStateDelta.cs b/.Libplanet.Extensions.ActionEvaluatorCommonComponents/AccountStateDelta.cs index b7485ceef7..da9f57dce7 100644 --- a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/AccountStateDelta.cs +++ b/.Libplanet.Extensions.ActionEvaluatorCommonComponents/AccountStateDelta.cs @@ -5,6 +5,7 @@ using Libplanet.Action; using Libplanet.Action.State; using Libplanet.Crypto; +using Libplanet.Store.Trie; using Libplanet.Types.Assets; using Libplanet.Types.Consensus; @@ -118,6 +119,8 @@ public AccountStateDelta(byte[] bytes) { } + public ITrie Trie => throw new NotSupportedException(); + public IAccountDelta Delta => _delta; public IValue? GetState(Address address) => diff --git a/.Libplanet.Extensions.RemoteActionEvaluator/RemoteActionEvaluator.cs b/.Libplanet.Extensions.RemoteActionEvaluator/RemoteActionEvaluator.cs index 819011c445..1961bd3741 100644 --- a/.Libplanet.Extensions.RemoteActionEvaluator/RemoteActionEvaluator.cs +++ b/.Libplanet.Extensions.RemoteActionEvaluator/RemoteActionEvaluator.cs @@ -49,7 +49,7 @@ public IReadOnlyList Evaluate(IPreEvaluationBlock block) else { actionEvaluations[i].InputContext.PreviousState.BaseState = - _blockChainStates.GetBlockState(block.PreviousHash); + _blockChainStates.GetAccountState(block.PreviousHash); } actionEvaluations[i].OutputState.BaseState = diff --git a/.Libplanet.Extensions.RemoteBlockChainStates/RemoteBlockChainStates.cs b/.Libplanet.Extensions.RemoteBlockChainStates/RemoteBlockChainStates.cs index 040b022071..2c1ece8925 100644 --- a/.Libplanet.Extensions.RemoteBlockChainStates/RemoteBlockChainStates.cs +++ b/.Libplanet.Extensions.RemoteBlockChainStates/RemoteBlockChainStates.cs @@ -39,7 +39,7 @@ public ValidatorSet GetValidatorSet(BlockHash? offset) return new RemoteBlockState(_explorerEndpoint, offset).GetValidatorSet(); } - public IBlockState GetBlockState(BlockHash? offset) + public IAccountState GetAccountState(BlockHash? offset) { return new RemoteBlockState(_explorerEndpoint, offset); } diff --git a/.Libplanet.Extensions.RemoteBlockChainStates/RemoteBlockState.cs b/.Libplanet.Extensions.RemoteBlockChainStates/RemoteBlockState.cs index 08e047e54d..65527dda18 100644 --- a/.Libplanet.Extensions.RemoteBlockChainStates/RemoteBlockState.cs +++ b/.Libplanet.Extensions.RemoteBlockChainStates/RemoteBlockState.cs @@ -9,10 +9,11 @@ using Libplanet.Types.Blocks; using Libplanet.Types.Consensus; using Libplanet.Crypto; +using Libplanet.Store.Trie; namespace Libplanet.Extensions.RemoteBlockChainStates; -public class RemoteBlockState : IBlockState +public class RemoteBlockState : IAccountState { private readonly Uri _explorerEndpoint; private readonly GraphQLHttpClient _graphQlHttpClient; @@ -164,6 +165,8 @@ public ValidatorSet GetValidatorSet() .ToList()); } + public ITrie Trie => throw new NotSupportedException(); + public BlockHash? BlockHash { get; } private class GetStatesResponseType diff --git a/Lib9c.MessagePack/AccountStateDelta.cs b/Lib9c.MessagePack/AccountStateDelta.cs index 60fc978b45..864d8eea5a 100644 --- a/Lib9c.MessagePack/AccountStateDelta.cs +++ b/Lib9c.MessagePack/AccountStateDelta.cs @@ -8,6 +8,7 @@ using Libplanet.Action; using Libplanet.Action.State; using Libplanet.Crypto; +using Libplanet.Store.Trie; using Libplanet.Types.Assets; using Libplanet.Types.Consensus; @@ -63,6 +64,8 @@ public AccountStateDelta(byte[] bytes) { } + public ITrie Trie => throw new NotSupportedException(); + public IAccountDelta Delta => _delta; public IValue? GetState(Address address) => diff --git a/Lib9c/Action/ActionBaseExtensions.cs b/Lib9c/Action/ActionBaseExtensions.cs index 240215e538..94d5534e24 100644 --- a/Lib9c/Action/ActionBaseExtensions.cs +++ b/Lib9c/Action/ActionBaseExtensions.cs @@ -8,6 +8,7 @@ using Libplanet.Action.State; using Libplanet.Common; using Libplanet.Crypto; +using Libplanet.Store.Trie; using Libplanet.Types.Assets; using Libplanet.Types.Blocks; using Libplanet.Types.Consensus; @@ -88,6 +89,8 @@ public AddressTraceStateDelta(AddressTraceDelta delta) _delta = delta; } + public ITrie Trie => throw new NotSupportedException(); + public IAccountDelta Delta => _delta; public IImmutableSet
UpdatedAddresses => _delta.UpdatedAddresses; From c78374a68040c20f8095a6cf27a535169ba06624 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Fri, 8 Sep 2023 12:35:05 +0900 Subject: [PATCH 3/3] Bump libplanet to 3.3.1 --- .Libplanet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Libplanet b/.Libplanet index aa72117b88..7fbe52e2b3 160000 --- a/.Libplanet +++ b/.Libplanet @@ -1 +1 @@ -Subproject commit aa72117b8887ec9e189cac97cefc3fa77966dd81 +Subproject commit 7fbe52e2b3351d4811ecc6da2a09a2f45f4aabeb