Skip to content

Commit

Permalink
Merge pull request #2135 from greymistcube/bump/libplanet-to-3.3.0
Browse files Browse the repository at this point in the history
⬆️ Bump libplanet to 3.3.1
  • Loading branch information
greymistcube authored Sep 8, 2023
2 parents f62cad2 + c78374a commit 6a5fd2f
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .Lib9c.Tests/Action/MockState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -79,6 +80,8 @@ private MockState(

public static MockState Empty => _empty;

public ITrie Trie => throw new NotSupportedException();

public IImmutableDictionary<Address, IValue> States => _states;

public IImmutableDictionary<(Address, Currency), BigInteger> Fungibles => _fungibles;
Expand Down
3 changes: 3 additions & 0 deletions .Lib9c.Tests/Action/MockStateDelta.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -41,6 +42,8 @@ private MockStateDelta(IAccountState baseState, IAccountDelta delta)
TotalUpdatedFungibles = ImmutableDictionary<(Address, Currency), BigInteger>.Empty;
}

public ITrie Trie => throw new NotSupportedException();

/// <inheritdoc/>
public IAccountDelta Delta { get; private set; }

Expand Down
2 changes: 1 addition & 1 deletion .Libplanet
Submodule .Libplanet updated 86 files
+39 −8 .circleci/config.yml
+159 −0 .gitallowed
+85 −0 CHANGES.md
+6 −6 Libplanet.Action.Tests/ActionContextTest.cs
+3 −7 Libplanet.Action.Tests/ActionEvaluationTest.cs
+35 −62 Libplanet.Action.Tests/Mocks/MockAccountState.cs
+2 −2 Libplanet.Action.Tests/Sys/InitializeTest.cs
+1 −1 Libplanet.Action/ActionEvaluator.cs
+80 −148 Libplanet.Action/State/Account.cs
+2 −2 Libplanet.Action/State/AccountDelta.cs
+83 −0 Libplanet.Action/State/AccountState.cs
+3 −3 Libplanet.Action/State/AccountStateCache.cs
+0 −114 Libplanet.Action/State/BlockState.cs
+4 −6 Libplanet.Action/State/IAccountState.cs
+12 −11 Libplanet.Action/State/IBlockChainStates.cs
+0 −17 Libplanet.Action/State/IBlockState.cs
+1 −2 Libplanet.Common/ByteUtil.cs
+2 −0 Libplanet.Explorer.Executable/Program.cs
+49 −10 Libplanet.Explorer.Tests/Queries/StateQueryTest.cs
+14 −13 Libplanet.Extensions.Cocona.Tests/Commands/MptCommandTest.cs
+6 −0 Libplanet.Extensions.Cocona.Tests/Commands/StatsCommandTest.cs
+13 −0 Libplanet.Extensions.Cocona.Tests/Commands/StoreCommandTest.cs
+6 −6 Libplanet.Extensions.Cocona/Commands/MptCommand.cs
+36 −63 Libplanet.Net.Tests/SwarmTest.Broadcast.cs
+45 −35 Libplanet.Net.Tests/SwarmTest.Preload.cs
+91 −115 Libplanet.Net.Tests/SwarmTest.cs
+19 −0 Libplanet.Net.Tests/Transports/TransportTest.cs
+3 −1 Libplanet.Net/Transports/NetMQTransport.cs
+3 −29 Libplanet.RocksDBStore/RocksDBKeyValueStore.cs
+33 −25 Libplanet.RocksDBStore/RocksDBStore.cs
+11 −1 Libplanet.RocksDBStore/RocksDBUtils.cs
+2 −13 Libplanet.Store/DefaultStore.cs
+16 −0 Libplanet.Store/IStateStore.cs
+1 −5 Libplanet.Store/MemoryStore.cs
+1 −1 Libplanet.Store/StateStoreExtensions.cs
+12 −5 Libplanet.Store/StoreExtensions.cs
+0 −22 Libplanet.Store/Trie/CacheableKeyValueStore.cs
+0 −25 Libplanet.Store/Trie/DefaultKeyValueStore.cs
+0 −10 Libplanet.Store/Trie/IKeyValueStore.cs
+95 −6 Libplanet.Store/Trie/ITrie.cs
+4 −46 Libplanet.Store/Trie/KeyBytes.cs
+0 −17 Libplanet.Store/Trie/MemoryKeyValueStore.cs
+160 −0 Libplanet.Store/Trie/MerkleTrie.Diff.cs
+37 −173 Libplanet.Store/Trie/MerkleTrie.Path.cs
+151 −208 Libplanet.Store/Trie/MerkleTrie.cs
+0 −84 Libplanet.Store/Trie/MerkleTrieExtensions.cs
+179 −0 Libplanet.Store/Trie/Nibbles.cs
+3 −0 Libplanet.Store/Trie/Nodes/BaseNode.cs
+8 −35 Libplanet.Store/Trie/Nodes/FullNode.cs
+3 −1 Libplanet.Store/Trie/Nodes/HashNode.cs
+115 −69 Libplanet.Store/Trie/Nodes/NodeDecoder.cs
+17 −18 Libplanet.Store/Trie/Nodes/ShortNode.cs
+4 −9 Libplanet.Store/Trie/Nodes/ValueNode.cs
+128 −0 Libplanet.Store/Trie/PathCursor.cs
+2 −3 Libplanet.Store/Trie/TrieExtensions.cs
+161 −0 Libplanet.Store/TrieStateStore.Commit.cs
+6 −23 Libplanet.Store/TrieStateStore.cs
+15 −22 Libplanet.Tests/Action/AccountTest.cs
+0 −4 Libplanet.Tests/Action/AccountV1Test.cs
+3 −3 Libplanet.Tests/Action/ActionEvaluatorTest.cs
+0 −1 Libplanet.Tests/Blockchain/BlockChainTest.cs
+1 −2 Libplanet.Tests/Blockchain/Renderers/AnonymousActionRendererTest.cs
+1 −2 Libplanet.Tests/Blockchain/Renderers/LoggedActionRendererTest.cs
+3 −3 Libplanet.Tests/Fixtures/IntegerSet.cs
+3 −6 Libplanet.Tests/Store/MemoryStoreTest.cs
+9 −26 Libplanet.Tests/Store/StateStoreExtensionsTest.cs
+6 −0 Libplanet.Tests/Store/StateStoreTracker.cs
+1 −15 Libplanet.Tests/Store/StoreLoaderAttributeTest.cs
+0 −19 Libplanet.Tests/Store/Trie/KeyBytesTest.cs
+2 −18 Libplanet.Tests/Store/Trie/KeyValueStoreTest.cs
+96 −0 Libplanet.Tests/Store/Trie/MerkleTrieDiffTest.cs
+0 −69 Libplanet.Tests/Store/Trie/MerkleTrieExtensionsTest.cs
+0 −176 Libplanet.Tests/Store/Trie/MerkleTriePathCursorTest.cs
+144 −11 Libplanet.Tests/Store/Trie/MerkleTrieTest.cs
+68 −0 Libplanet.Tests/Store/Trie/NibblesTest.cs
+47 −15 Libplanet.Tests/Store/Trie/Nodes/NodeDecoderTest.cs
+3 −3 Libplanet.Tests/Store/Trie/Nodes/ShortNodeTest.cs
+123 −0 Libplanet.Tests/Store/Trie/PathCursorTest.cs
+10 −10 Libplanet.Tests/Store/Trie/TrieTest.cs
+61 −0 Libplanet.Tests/Store/TrieStateStoreCommitTest.cs
+10 −16 Libplanet.Tests/Store/TrieStateStoreTest.cs
+8 −4 Libplanet/Blockchain/BlockChain.Evaluate.cs
+3 −5 Libplanet/Blockchain/BlockChain.cs
+12 −9 Libplanet/Blockchain/BlockChainStates.cs
+9 −39 Libplanet/Blockchain/NullChainStates.cs
+1 −1 Libplanet/Libplanet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -118,6 +119,8 @@ public AccountStateDelta(byte[] bytes)
{
}

public ITrie Trie => throw new NotSupportedException();

public IAccountDelta Delta => _delta;

public IValue? GetState(Address address) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public IReadOnlyList<IActionEvaluation> Evaluate(IPreEvaluationBlock block)
else
{
actionEvaluations[i].InputContext.PreviousState.BaseState =
_blockChainStates.GetBlockState(block.PreviousHash);
_blockChainStates.GetAccountState(block.PreviousHash);
}

actionEvaluations[i].OutputState.BaseState =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -164,6 +165,8 @@ public ValidatorSet GetValidatorSet()
.ToList());
}

public ITrie Trie => throw new NotSupportedException();

public BlockHash? BlockHash { get; }

private class GetStatesResponseType
Expand Down
3 changes: 3 additions & 0 deletions Lib9c.MessagePack/AccountStateDelta.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -63,6 +64,8 @@ public AccountStateDelta(byte[] bytes)
{
}

public ITrie Trie => throw new NotSupportedException();

public IAccountDelta Delta => _delta;

public IValue? GetState(Address address) =>
Expand Down
3 changes: 3 additions & 0 deletions Lib9c/Action/ActionBaseExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -88,6 +89,8 @@ public AddressTraceStateDelta(AddressTraceDelta delta)
_delta = delta;
}

public ITrie Trie => throw new NotSupportedException();

public IAccountDelta Delta => _delta;

public IImmutableSet<Address> UpdatedAddresses => _delta.UpdatedAddresses;
Expand Down

0 comments on commit 6a5fd2f

Please sign in to comment.