@@ -133,31 +133,37 @@ protected EthereumTestResult RunTest(GeneralStateTest test, ITxTracer txTracer)
133
133
}
134
134
135
135
ValidationResult txIsValid = _txValidator . IsWellFormed ( test . Transaction , spec ) ;
136
-
136
+ TransactionResult ? txResult = null ;
137
137
if ( txIsValid )
138
138
{
139
- transactionProcessor . Execute ( test . Transaction , new BlockExecutionContext ( header ) , txTracer ) ;
139
+ txResult = transactionProcessor . Execute ( test . Transaction , new BlockExecutionContext ( header ) , txTracer ) ;
140
140
}
141
141
else
142
142
{
143
143
_logger . Info ( $ "Skipping invalid tx with error: { txIsValid . Error } ") ;
144
144
}
145
145
146
146
stopwatch . Stop ( ) ;
147
+ if ( txResult is not null && txResult . Value == TransactionResult . Ok )
148
+ {
149
+ stateProvider . Commit ( specProvider . GetSpec ( ( ForkActivation ) 1 ) ) ;
150
+ stateProvider . CommitTree ( 1 ) ;
151
+
152
+ // '@winsvega added a 0-wei reward to the miner , so we had to add that into the state test execution phase. He needed it for retesteth.'
153
+ if ( ! stateProvider . AccountExists ( test . CurrentCoinbase ) )
154
+ {
155
+ stateProvider . CreateAccount ( test . CurrentCoinbase , 0 ) ;
156
+ }
147
157
148
- stateProvider . Commit ( specProvider . GetSpec ( ( ForkActivation ) 1 ) ) ;
149
- stateProvider . CommitTree ( 1 ) ;
158
+ stateProvider . Commit ( specProvider . GetSpec ( ( ForkActivation ) 1 ) ) ;
150
159
151
- // '@winsvega added a 0-wei reward to the miner , so we had to add that into the state test execution phase. He needed it for retesteth.'
152
- if ( ! stateProvider . AccountExists ( test . CurrentCoinbase ) )
160
+ stateProvider . RecalculateStateRoot ( ) ;
161
+ }
162
+ else
153
163
{
154
- stateProvider . CreateAccount ( test . CurrentCoinbase , 0 ) ;
164
+ stateProvider . Reset ( ) ;
155
165
}
156
166
157
- stateProvider . Commit ( specProvider . GetSpec ( ( ForkActivation ) 1 ) ) ;
158
-
159
- stateProvider . RecalculateStateRoot ( ) ;
160
-
161
167
List < string > differences = RunAssertions ( test , stateProvider ) ;
162
168
EthereumTestResult testResult = new ( test . Name , test . ForkName , differences . Count == 0 ) ;
163
169
testResult . TimeInMs = stopwatch . Elapsed . TotalMilliseconds ;
0 commit comments