File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -138,12 +138,6 @@ pub fn validate_against_state_and_deduct_caller<
138
138
is_nonce_check_disabled,
139
139
) ?;
140
140
141
- // Bump the nonce for calls. Nonce for CREATE will be bumped in `make_create_frame`.
142
- if tx. kind ( ) . is_call ( ) {
143
- // Nonce is already checked
144
- caller_account. info . nonce = caller_account. info . nonce . saturating_add ( 1 ) ;
145
- }
146
-
147
141
let max_balance_spending = tx. max_balance_spending ( ) ?;
148
142
149
143
// Check if account has enough balance for `gas_limit * max_fee`` and value transfer.
@@ -178,6 +172,12 @@ pub fn validate_against_state_and_deduct_caller<
178
172
caller_account. mark_touch ( ) ;
179
173
caller_account. info . balance = new_balance;
180
174
175
+ // Bump the nonce for calls. Nonce for CREATE will be bumped in `make_create_frame`.
176
+ if tx. kind ( ) . is_call ( ) {
177
+ // Nonce is already checked
178
+ caller_account. info . nonce = caller_account. info . nonce . saturating_add ( 1 ) ;
179
+ }
180
+
181
181
journal. caller_accounting_journal_entry ( tx. caller ( ) , old_balance, tx. kind ( ) . is_call ( ) ) ;
182
182
Ok ( ( ) )
183
183
}
Original file line number Diff line number Diff line change @@ -157,11 +157,6 @@ where
157
157
) ?;
158
158
}
159
159
160
- // Bump the nonce for calls. Nonce for CREATE will be bumped in `handle_create`.
161
- if tx. kind ( ) . is_call ( ) {
162
- caller_account. info . nonce = caller_account. info . nonce . saturating_add ( 1 ) ;
163
- }
164
-
165
160
let max_balance_spending = tx. max_balance_spending ( ) ?. saturating_add ( additional_cost) ;
166
161
167
162
// old balance is journaled before mint is incremented.
@@ -210,6 +205,11 @@ where
210
205
caller_account. mark_touch ( ) ;
211
206
caller_account. info . balance = new_balance;
212
207
208
+ // Bump the nonce for calls. Nonce for CREATE will be bumped in `handle_create`.
209
+ if tx. kind ( ) . is_call ( ) {
210
+ caller_account. info . nonce = caller_account. info . nonce . saturating_add ( 1 ) ;
211
+ }
212
+
213
213
// NOTE: all changes to the caller account should journaled so in case of error
214
214
// we can revert the changes.
215
215
journal. caller_accounting_journal_entry ( tx. caller ( ) , old_balance, tx. kind ( ) . is_call ( ) ) ;
You can’t perform that action at this time.
0 commit comments