From d90205752dd63b26516d746eb9e61f9573df76b8 Mon Sep 17 00:00:00 2001 From: Chanhyuck Ko Date: Mon, 22 Apr 2024 19:26:09 +0900 Subject: [PATCH] bugfix: fix error where txaction signer is not tx's signer --- Libplanet.Action/ActionEvaluator.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Libplanet.Action/ActionEvaluator.cs b/Libplanet.Action/ActionEvaluator.cs index 083d2c4e384..11832cdb842 100644 --- a/Libplanet.Action/ActionEvaluator.cs +++ b/Libplanet.Action/ActionEvaluator.cs @@ -496,7 +496,7 @@ internal IEnumerable EvaluateTx( beginTxActions.Length > 0) { evaluations = evaluations.AddRange( - EvaluatePolicyBeginTxActions(blockHeader, previousState)); + EvaluatePolicyBeginTxActions(blockHeader, tx, previousState)); previousState = evaluations.Last().OutputState; } @@ -519,7 +519,7 @@ internal IEnumerable EvaluateTx( ? evaluations.Last().OutputState : previousState; evaluations = evaluations.AddRange( - EvaluatePolicyEndTxActions(blockHeader, previousState)); + EvaluatePolicyEndTxActions(blockHeader, tx, previousState)); } return evaluations; @@ -591,6 +591,7 @@ internal ActionEvaluation[] EvaluatePolicyEndBlockActions( /// . /// /// The header of the block to evaluate. + /// The transaction that the tx action belongs to. /// The states immediately before the evaluation of /// the held by the instance. /// The of evaluating @@ -599,6 +600,7 @@ internal ActionEvaluation[] EvaluatePolicyEndBlockActions( [Pure] internal ActionEvaluation[] EvaluatePolicyBeginTxActions( IPreEvaluationBlockHeader blockHeader, + ITransaction transaction, IWorld previousState) { _logger.Information( @@ -607,10 +609,11 @@ internal ActionEvaluation[] EvaluatePolicyBeginTxActions( return EvaluateActions( blockHeader: blockHeader, - tx: null, + tx: transaction, previousState: previousState, actions: _policyActionsRegistry.BeginTxActionsGetter(blockHeader), stateStore: _stateStore, + blockAction: true, logger: _logger).ToArray(); } @@ -620,6 +623,7 @@ internal ActionEvaluation[] EvaluatePolicyBeginTxActions( /// . /// /// The header of the block to evaluate. + /// The transaction that the tx action belongs to. /// The states immediately before the evaluation of /// the held by the instance. /// The of evaluating @@ -628,6 +632,7 @@ internal ActionEvaluation[] EvaluatePolicyBeginTxActions( [Pure] internal ActionEvaluation[] EvaluatePolicyEndTxActions( IPreEvaluationBlockHeader blockHeader, + ITransaction transaction, IWorld previousState) { _logger.Information( @@ -636,7 +641,7 @@ internal ActionEvaluation[] EvaluatePolicyEndTxActions( return EvaluateActions( blockHeader: blockHeader, - tx: null, + tx: transaction, previousState: previousState, actions: _policyActionsRegistry.EndTxActionsGetter(blockHeader), stateStore: _stateStore,