return Ok(Vec::new()); }; let balances_buffer = balances.value(); let mut balances = Vec::new(); let mut i = 0; while i < balances_buffer.len() { let (id, length) = runes::varint::decode(&balances_buffer[i..]).unwrap(); i += length; let (amount, length) = runes::varint::decode(&balances_buffer[i..]).unwrap(); i += length; let id = RuneId::try_from(id).unwrap(); let entry = RuneEntry::load(id_to_rune_entries.get(id.store())?.unwrap().value()); balances.push(( entry.rune, Pile { amount, divisibility: entry.divisibility, symbol: entry.symbol, }, )); } Ok(balances) } #[cfg(test)] pub(crate) fn get_rune_balances(&self) -> Vec<(OutPoint, Vec<(RuneId, u128)>)> { let mut result = Vec::new(); for entry in self .database .begin_read() .unwrap() .open_table(OUTPOINT_TO_RUNE_BALANCES) .unwrap() .iter() .unwrap() { let (outpoint, balances_buffer) = entry.unwrap();
Inscription number 44,978,095
Genesis block 819,052
File type text
File size 1.05 KB
Creation date Nov 29,2023 11:55 pm