Skip to content

Commit

Permalink
fix: Build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
OnedgeLee committed Jun 12, 2024
1 parent 8952272 commit 267b555
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
10 changes: 1 addition & 9 deletions NineChronicles.Headless.Executable.Tests/ProgramTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
20 changes: 20 additions & 0 deletions NineChronicles.Headless.Executable/Store/AnonymousStore.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -47,6 +49,9 @@ public class AnonymousStore : IStore
public Action<BlockCommit> PutBlockCommit { get; set; }
public Action<BlockHash> DeleteBlockCommit { get; set; }
public Func<IEnumerable<BlockHash>> GetBlockCommitHashes { get; set; }
public Func<BlockHash, HashDigest<SHA256>?> GetNextStateRootHash { get; set; }
public Action<BlockHash, HashDigest<SHA256>> PutNextStateRootHash { get; set; }
public Action<BlockHash> DeleteNextStateRootHash { get; set; }
#pragma warning restore CS8618

void IDisposable.Dispose()
Expand Down Expand Up @@ -237,4 +242,19 @@ IEnumerable<BlockHash> IStore.GetBlockCommitHashes()
{
return GetBlockCommitHashes();
}

HashDigest<SHA256>? IStore.GetNextStateRootHash(BlockHash blockHash)
{
return GetNextStateRootHash(blockHash);
}

void IStore.PutNextStateRootHash(BlockHash blockHash, HashDigest<SHA256> nextStateRootHash)
{
PutNextStateRootHash(blockHash, nextStateRootHash);
}

void IStore.DeleteNextStateRootHash(BlockHash blockHash)
{
DeleteNextStateRootHash(blockHash);
}
}

0 comments on commit 267b555

Please sign in to comment.