}
.store(),
buffer.as_slice(),
)?;
}
// increment entries with burned runes
for (id, amount) in burned {
let id = RuneId::try_from(id).unwrap().store();
let mut entry = RuneEntry::load(self.id_to_entry.get(id)?.unwrap().value());
entry.burned += amount;
self.id_to_entry.insert(id, entry.store())?;
}
Ok(())
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn claim_from_id() {
assert_eq!(claim(1), None);
assert_eq!(claim(1 | CLAIM_BIT), Some(1));
}
}