let outpoint = OutPoint::load(*outpoint.value()); let balances_buffer = balances_buffer.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 (balance, length) = runes::varint::decode(&balances_buffer[i..]).unwrap(); i += length; balances.push((RuneId::try_from(id).unwrap(), balance)); } result.push((outpoint, balances)); } result } pub(crate) fn block_header(&self, hash: BlockHash) -> Result> { self.client.get_block_header(&hash).into_option() } pub(crate) fn block_header_info(&self, hash: BlockHash) -> Result> { self.client.get_block_header_info(&hash).into_option() } pub(crate) fn get_block_by_height(&self, height: u32) -> Result> { Ok( self .client .get_block_hash(height.into()) .into_option()?