diff --git a/NineChronicles.Headless.Executable/Commands/ReplayCommand.Queries.cs b/NineChronicles.Headless.Executable/Commands/ReplayCommand.Queries.cs index 3d61c5b89..7ad4950d5 100644 --- a/NineChronicles.Headless.Executable/Commands/ReplayCommand.Queries.cs +++ b/NineChronicles.Headless.Executable/Commands/ReplayCommand.Queries.cs @@ -50,6 +50,7 @@ query GetBlockData($hash: ID!) stateRootHash } stateRootHash + protocolVersion } }} } @@ -90,6 +91,7 @@ private sealed class BlockType public string? PreEvaluationHash { get; set; } public BlockType? PreviousBlock { get; set; } public string? StateRootHash { get; set; } + public int? ProtocolVersion { get; set; } } private sealed class TransactionQueryType diff --git a/NineChronicles.Headless.Executable/Commands/ReplayCommand.cs b/NineChronicles.Headless.Executable/Commands/ReplayCommand.cs index d5a1f7a8d..bd19e0d31 100644 --- a/NineChronicles.Headless.Executable/Commands/ReplayCommand.cs +++ b/NineChronicles.Headless.Executable/Commands/ReplayCommand.cs @@ -388,7 +388,12 @@ public int RemoteTx( var previousBlockHashStateRootHash = block?.PreviousBlock?.StateRootHash; var preEvaluationHashValue = block?.PreEvaluationHash; var minerValue = block?.Miner; - if (previousBlockHashValue is null || preEvaluationHashValue is null || minerValue is null || previousBlockHashStateRootHash is null) + var protocolVersion = block?.ProtocolVersion; + if (previousBlockHashValue is null + || preEvaluationHashValue is null + || minerValue is null + || previousBlockHashStateRootHash is null + || protocolVersion is null) { throw new CommandExitedException("Failed to get block from query", -1); } @@ -428,7 +433,7 @@ public int RemoteTx( var actionEvaluations = EvaluateActions( preEvaluationHash: HashDigest.FromString(preEvaluationHashValue), blockIndex: transactionResult.BlockIndex ?? 0, - blockProtocolVersion: 0, + blockProtocolVersion: (int)protocolVersion, txid: transaction.Id, previousStates: previousStates, miner: miner,