Skip to content

Commit ab8e795

Browse files
committed
Add new pallet-revive::ExecConfig fields
1 parent 68e87f6 commit ab8e795

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

crates/revive-types/src/primitives.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ pub struct ExecConfig {
247247
/// The origin's nonce is already incremented pre-dispatch by the `CheckNonce`
248248
/// transaction extension.
249249
///
250-
/// This does not apply to contract initiated instantiations. Those will always bump
251-
/// the instantiating contract's nonce.
250+
/// This does not apply to contract initiated instantiations. Those will always
251+
/// bump the instantiating contract's nonce.
252252
pub bump_nonce: bool,
253253
/// Whether deposits will be withdrawn from the `pallet_transaction_payment` credit
254254
/// (`Some`) free balance (`None`).
@@ -259,4 +259,16 @@ pub struct ExecConfig {
259259
///
260260
/// It is determined when transforming `eth_transact` into a proper extrinsic.
261261
pub effective_gas_price: Option<U256>,
262+
/// Whether this configuration was created for a dry-run execution.
263+
/// Use to enable logic that should only run in dry-run mode.
264+
pub is_dry_run: bool,
265+
/// An optional mock handler that can be used to override certain behaviors.
266+
/// This is primarily used for testing purposes and should be `None` in production
267+
/// environments.
268+
///
269+
/// __Note:__ We don't support this in ink! yet!
270+
/// The correct `pallet-revive` type is `Option<Box<dyn MockHandler<T>>>`. The unit
271+
/// type here is just a placeholder so that we don't have to import everything around
272+
/// `MockHandler`.
273+
pub mock_handler: Option<()>,
262274
}

crates/sandbox/src/api/revive_api.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ where
213213
bump_nonce: true,
214214
collect_deposit_from_hold: None,
215215
effective_gas_price: None,
216+
is_dry_run: false,
217+
mock_handler: None,
216218
},
217219
)
218220
})
@@ -241,6 +243,8 @@ where
241243
bump_nonce: true,
242244
collect_deposit_from_hold: None,
243245
effective_gas_price: None,
246+
is_dry_run: false,
247+
mock_handler: None,
244248
},
245249
)
246250
})
@@ -282,6 +286,8 @@ where
282286
bump_nonce: true,
283287
collect_deposit_from_hold: None,
284288
effective_gas_price: None,
289+
is_dry_run: false,
290+
mock_handler: None,
285291
},
286292
)
287293
})

integration-tests/public/runtime-call-contract/sandbox-runtime/pallet-revive-caller/src/executor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ where
6969
bump_nonce: true,
7070
collect_deposit_from_hold: None,
7171
effective_gas_price: None,
72+
is_dry_run: false,
73+
mock_handler: None,
7274
},
7375
);
7476

0 commit comments

Comments
 (0)