dusk_vm/execute/config.rs
1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4//
5// Copyright (c) DUSK NETWORK. All rights reserved.
6
7/// Configuration for the execution of a transaction.
8#[derive(Debug, Clone)]
9pub struct Config {
10 /// The amount of gas points charged for each byte in a contract-deployment
11 /// bytecode.
12 pub gas_per_deploy_byte: u64,
13 /// The minimum gas points charged for a contract deployment.
14 pub min_deploy_points: u64,
15 /// The minimum gas price set for a contract deployment
16 pub min_deploy_gas_price: u64,
17 /// Enable the public sender metadata in the transaction.
18 ///
19 /// This field may be deprecated after the feature rollout.
20 pub with_public_sender: bool,
21}
22
23impl Default for Config {
24 fn default() -> Self {
25 Self::DEFAULT
26 }
27}
28
29impl Config {
30 /// Create a config with all values to default
31 pub const DEFAULT: Config = Config {
32 gas_per_deploy_byte: 0,
33 min_deploy_points: 0,
34 min_deploy_gas_price: 0,
35 with_public_sender: false,
36 };
37}