diff --git a/NineChronicles.Headless.Executable/Commands/ReplayCommand.Privates.cs b/NineChronicles.Headless.Executable/Commands/ReplayCommand.Privates.cs index 9581815f3..f04346ddb 100644 --- a/NineChronicles.Headless.Executable/Commands/ReplayCommand.Privates.cs +++ b/NineChronicles.Headless.Executable/Commands/ReplayCommand.Privates.cs @@ -70,11 +70,6 @@ public ActionContext( public bool BlockAction => TxId is null; - public void PutLog(string log) - { - // NOTE: Not implemented yet. See also Lib9c.Tests.Action.ActionContext.PutLog(). - } - public void UseGas(long gas) { } @@ -145,8 +140,14 @@ public ValidatorSet GetValidatorSet(BlockHash? offset) public IAccountState GetAccountState(BlockHash? offset) { - return new LocalCacheAccountState(_rocksDb, _source.GetAccountState, offset); + return new LocalCacheAccountState( + _rocksDb, + _source.GetAccountState, + offset); } + + public IAccountState GetAccountState(HashDigest? hash) + => throw new NotImplementedException(); } private sealed class LocalCacheAccountState : IAccountState @@ -158,11 +159,11 @@ private sealed class LocalCacheAccountState : IAccountState public LocalCacheAccountState( RocksDb rocksDb, - Func sourceAccountStateGetter, + Func sourceAccountStateGetterWithBlockHash, BlockHash? offset) { _rocksDb = rocksDb; - _sourceAccountStateGetter = sourceAccountStateGetter; + _sourceAccountStateGetter = sourceAccountStateGetterWithBlockHash; _offset = offset; } diff --git a/NineChronicles.Headless.Executable/Commands/ReplayCommand.cs b/NineChronicles.Headless.Executable/Commands/ReplayCommand.cs index c332de64c..caa50c865 100644 --- a/NineChronicles.Headless.Executable/Commands/ReplayCommand.cs +++ b/NineChronicles.Headless.Executable/Commands/ReplayCommand.cs @@ -101,7 +101,7 @@ public int Tx( // Evaluate tx. IAccountState previousBlockStates = blockChain.GetAccountState(previousBlock.Hash); - IAccount previousStates = AccountStateDelta.Create(previousBlockStates); + IAccount previousStates = new Account(previousBlockStates); var actions = tx.Actions.Select(a => ToAction(a)); var actionEvaluations = EvaluateActions( preEvaluationHash: targetBlock.PreEvaluationHash, @@ -399,8 +399,7 @@ public int RemoteTx( cacheDirectory ?? Path.Join(Path.GetTempPath(), "ncd-replay-remote-tx-cache")); var previousBlockHash = BlockHash.FromString(previousBlockHashValue); - var previousStates = - AccountStateDelta.Create(blockChainStates.GetAccountState(previousBlockHash)); + var previousStates = new Account(blockChainStates.GetAccountState(previousBlockHash)); var actions = transaction.Actions .Select(ToAction)