1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
use crate::disassembler::UnknownHandling; use crate::error::Result; use crate::manifest::ContractManifest; pub(super) fn parse_manifest( manifest_json: Option<&str>, strict: bool, ) -> Result<Option<ContractManifest>> { manifest_json .map(|json| { if strict { ContractManifest::from_json_str_strict(json) } else { ContractManifest::from_json_str(json) } }) .transpose() } pub(super) fn unknown_handling(fail_on_unknown_opcodes: bool) -> UnknownHandling { if fail_on_unknown_opcodes { UnknownHandling::Error } else { UnknownHandling::Permit } }