multiversx_sc_meta_lib/tools/wasm_extractor/
opcode_version.rs

1/// There is another implementation of this in the executor, but unreleased.
2///
3/// TODO: unify them after the executor changes are released.
4#[derive(Default, Clone, Copy, Debug, PartialEq, Eq)]
5pub enum OpcodeVersion {
6    #[default]
7    V1,
8    V2,
9}
10
11impl OpcodeVersion {
12    /// Parses the opcode version from a string, as found in the settings.
13    pub fn from_settings_str(value: &str) -> Option<Self> {
14        match value {
15            "1" => Some(OpcodeVersion::V1),
16            "2" => Some(OpcodeVersion::V2),
17            _ => None,
18        }
19    }
20}