use std::collections::BTreeMap;
use serde::Deserialize;
use serde::Serialize;
use self::bytecode::Bytecode;
use self::bytecode::DeployedBytecode;
pub mod bytecode;
#[derive(Debug, Default, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct EVM {
#[serde(rename = "assembly", skip_serializing_if = "Option::is_none")]
pub assembly_text: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bytecode: Option<Bytecode>,
#[serde(skip_serializing_if = "Option::is_none")]
pub deployed_bytecode: Option<DeployedBytecode>,
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
pub method_identifiers: BTreeMap<String, String>,
}
impl EVM {
pub fn modify(&mut self, assembly_text: String, bytecode: String) {
self.assembly_text = Some(assembly_text);
self.bytecode = Some(Bytecode::new(bytecode.clone()));
self.deployed_bytecode = Some(DeployedBytecode::new(bytecode));
}
}