fn slice_edge<T: HashmapType + ?Sized>(
    mut slice: SliceData,
    bit_len: usize,
    prefix: SliceData,
    mut label: SliceData,
    mut key: SliceData,
    leaf: &BuilderData,
    gas_consumer: &mut dyn GasConsumer
) -> Result<BuilderData> {
    key.shrink_data(1..);
    let label_bit = label.get_next_bit()?;
    let length = bit_len.checked_sub(prefix.remaining_bits() + 1).ok_or(ExceptionCode::CellUnderflow)?;
    let is_leaf = T::is_leaf(&mut slice);
    // Remainder of tree
    let existing_cell = gas_consumer.finalize_cell(T::make_cell_with_label_and_data(label, length, is_leaf, &slice)?)?;
    // Leaf for fork
    let another_cell = gas_consumer.finalize_cell(T::make_cell_with_label_and_builder(key, length, true, leaf)?)?;
    let (builder, _remainder) = T::make_fork(&prefix, bit_len, existing_cell, another_cell, label_bit)?;
    Ok(builder)
}
/// Slices the edge and put new leaf
Slices the edge and put new leaf
Slices the edge and put new leaf
fn slice_edge<T: HashmapType + ?Sized>(
    mut slice: SliceData,
    bit_len: usize,
    prefix: SliceData,
    mut label: SliceData,
    mut key: SliceData,
    leaf: &BuilderData,
    gas_consumer: &mut dyn GasConsumer
) -> Result<BuilderData> {
    key.shrink_data(1..);
    let label_bit = label.get_next_bit()?;
    let length = bit_len.checked_sub(prefix.remaining_bits() + 1).ok_or(ExceptionCode::CellUnderflow)?;
    let is_leaf = T::is_leaf(&mut slice);
    // Remainder of tree
    let existing_cell = gas_consumer.finalize_cell(T::make_cell_with_label_and_data(label, length, is_leaf, &slice)?)?;
    // Leaf for fork
    let another_cell = gas_consumer.finalize_cell(T::make_cell_with_label_and_builder(key, length, true, leaf)?)?;
    let (builder, _remainder) = T::make_fork(&prefix, bit_len, existing_cell, another_cell, label_bit)?;
    Ok(builder)
}
fn slice_edge < T : HashmapType + ? Sized > ( mut slice : SliceData , bit_len : usize , prefix : SliceData , mut label : SliceData , mut key : SliceData , leaf : & BuilderData , gas_consumer : & mut dyn GasConsumer ) -> Result < BuilderData > { key . shrink_data ( 1 .. ) ; let label_bit = label . get_next_bit ( ) ? ; let length = bit_len . checked_sub ( prefix . remaining_bits ( ) + 1 ) . ok_or ( ExceptionCode :: CellUnderflow ) ? ; let is_leaf = T :: is_leaf ( & mut slice ) ; // Remainder of tree let existing_cell = gas_consumer . finalize_cell ( T :: make_cell_with_label_and_data ( label , length , is_leaf , & slice ) ? ) ? ; // Leaf for fork let another_cell = gas_consumer . finalize_cell ( T :: make_cell_with_label_and_builder ( key , length , true , leaf ) ? ) ? ; let ( builder , _remainder ) = T :: make_fork ( & prefix , bit_len , existing_cell , another_cell , label_bit ) ? ; Ok ( builder ) }
Slices the edge and put new leaf
Slices the edge and put new leaf
slice
SliceData
bit_len
usize
prefix
SliceData
label
SliceData
key
SliceData
leaf
&BuilderData
gas_consumer
&mut dyn GasConsumer
slice
SliceData
bit_len
usize
prefix
SliceData
label
SliceData
key
SliceData
leaf
&BuilderData
gas_consumer
&mut dyn GasConsumer