pub fn emit_init(
state: &StateBlock,
derived: Option<&DerivedBlock>,
ctx: &mut FuncContext,
f: &mut Function,
) -> CodegenResult<()>Expand description
Emit the init() function (parameterless).
- Sets global gas_limit to DEFAULT_GAS_LIMIT
- Resets gas counter to 0
- Evaluates each state field’s default expression
- Builds the state record
- Evaluates derived fields