mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-15 04:31:08 +00:00
solc-json-interface: do not unconditionally skip serialization of custom keys (#337)
The data structure can be used to build the JSON input for `resolc` too. In that case serializing of provided custom options should not be dismissed. Makes the memory settings struct more modular as a drive-by. --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -11,16 +11,18 @@ pub mod memory;
|
||||
#[derive(Clone, Copy, Default, Debug, Serialize, Deserialize)]
|
||||
pub struct PolkaVM {
|
||||
/// The PolkaVM target machine memory configuration settings.
|
||||
pub memory_config: MemoryConfig,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub memory_config: Option<MemoryConfig>,
|
||||
/// Instruct LLVM to emit debug information.
|
||||
pub debug_information: bool,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub debug_information: Option<bool>,
|
||||
}
|
||||
|
||||
impl PolkaVM {
|
||||
pub fn new(memory_config: Option<MemoryConfig>, debug_information: bool) -> Self {
|
||||
Self {
|
||||
memory_config: memory_config.unwrap_or_default(),
|
||||
debug_information,
|
||||
memory_config,
|
||||
debug_information: Some(debug_information),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user