From 267b555b71e6f91eafb67fc442b3aacb03d5308e Mon Sep 17 00:00:00 2001 From: ilgyu Date: Wed, 12 Jun 2024 16:24:27 +0900 Subject: [PATCH] fix: Build fix --- .../ProgramTest.cs | 10 +--------- .../Store/AnonymousStore.cs | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/NineChronicles.Headless.Executable.Tests/ProgramTest.cs b/NineChronicles.Headless.Executable.Tests/ProgramTest.cs index 981dd506d..022a21e11 100644 --- a/NineChronicles.Headless.Executable.Tests/ProgramTest.cs +++ b/NineChronicles.Headless.Executable.Tests/ProgramTest.cs @@ -42,15 +42,7 @@ public ProgramTest() _storePath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); Directory.CreateDirectory(_storePath); _genesisBlockPath = Path.Combine(_storePath, "./genesis"); - - IStateStore stateStore = new TrieStateStore(new MemoryKeyValueStore()); - IActionLoader actionLoader = new NCActionLoader(); - IBlockPolicy blockPolicy = new BlockPolicySource(actionLoader, 1).GetPolicy(Nekoyume.Planet.Odin); - IActionEvaluator actionEvaluator = new ActionEvaluator( - _ => blockPolicy.BlockAction, - stateStore: stateStore, - actionTypeLoader: actionLoader); - var genesis = BlockChain.ProposeGenesisBlock(actionEvaluator); + var genesis = BlockChain.ProposeGenesisBlock(); Bencodex.Codec codec = new Bencodex.Codec(); _genesisBlockHash = ByteUtil.Hex(genesis.Hash.ByteArray); diff --git a/NineChronicles.Headless.Executable/Store/AnonymousStore.cs b/NineChronicles.Headless.Executable/Store/AnonymousStore.cs index d19a4c82c..c703c9bc5 100644 --- a/NineChronicles.Headless.Executable/Store/AnonymousStore.cs +++ b/NineChronicles.Headless.Executable/Store/AnonymousStore.cs @@ -1,5 +1,7 @@ using System; using System.Collections.Generic; +using System.Security.Cryptography; +using Libplanet.Common; using Libplanet.Crypto; using Libplanet.Store; using Libplanet.Types.Blocks; @@ -47,6 +49,9 @@ public class AnonymousStore : IStore public Action PutBlockCommit { get; set; } public Action DeleteBlockCommit { get; set; } public Func> GetBlockCommitHashes { get; set; } + public Func?> GetNextStateRootHash { get; set; } + public Action> PutNextStateRootHash { get; set; } + public Action DeleteNextStateRootHash { get; set; } #pragma warning restore CS8618 void IDisposable.Dispose() @@ -237,4 +242,19 @@ IEnumerable IStore.GetBlockCommitHashes() { return GetBlockCommitHashes(); } + + HashDigest? IStore.GetNextStateRootHash(BlockHash blockHash) + { + return GetNextStateRootHash(blockHash); + } + + void IStore.PutNextStateRootHash(BlockHash blockHash, HashDigest nextStateRootHash) + { + PutNextStateRootHash(blockHash, nextStateRootHash); + } + + void IStore.DeleteNextStateRootHash(BlockHash blockHash) + { + DeleteNextStateRootHash(blockHash); + } }