use std::collections::HashMap;
use num::BigUint;
#[derive(Debug)]
pub struct YulData {
constants: HashMap<String, BigUint>,
}
impl Default for YulData {
fn default() -> Self {
Self {
constants: HashMap::with_capacity(Self::CONSTANTS_HASHMAP_INITIAL_CAPACITY),
}
}
}
impl YulData {
const CONSTANTS_HASHMAP_INITIAL_CAPACITY: usize = 16;
pub fn new() -> Self {
Self::default()
}
pub fn get_constant(&self, name: &str) -> Option<BigUint> {
self.constants.get(name).cloned()
}
pub fn insert_constant(&mut self, name: String, value: BigUint) {
self.constants.insert(name, value);
}
}