Merge pull request #126 from mempool/junderw/fix-freebsd-ci
Update CI workflow to install rocksdb and run full build
This commit is contained in:
commit
467173e639
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@ -69,13 +69,14 @@ jobs:
|
||||
mv ./.cargohome/registry ~/.cargo/
|
||||
mv ./.cargohome/git ~/.cargo/
|
||||
rm -rf ./.cargohome
|
||||
pkg install -y git rsync gmake llvm rust
|
||||
pkg install -y git rsync gmake llvm rust rocksdb
|
||||
|
||||
run: |
|
||||
cargo check --no-default-features
|
||||
cargo check -F liquid
|
||||
cargo check -F electrum-discovery
|
||||
cargo check -F electrum-discovery,liquid
|
||||
cargo build --release --bin electrs
|
||||
rm -rf ./.cargohome
|
||||
mkdir -p ~/.cargo/registry/
|
||||
mkdir -p ~/.cargo/git/
|
||||
|
||||
@ -4,7 +4,7 @@ use elements::{confidential::Asset, PeginData, PegoutData, TxIn, TxOut};
|
||||
use crate::chain::{bitcoin_genesis_hash, BNetwork, Network};
|
||||
use crate::util::{FullHash, ScriptToAsm};
|
||||
|
||||
pub fn get_pegin_data(txout: &TxIn, network: Network) -> Option<PeginData> {
|
||||
pub fn get_pegin_data(txout: &TxIn, network: Network) -> Option<PeginData<'_>> {
|
||||
let pegged_asset_id = network.pegged_asset()?;
|
||||
txout
|
||||
.pegin_data()
|
||||
@ -15,7 +15,7 @@ pub fn get_pegout_data(
|
||||
txout: &TxOut,
|
||||
network: Network,
|
||||
parent_network: BNetwork,
|
||||
) -> Option<PegoutData> {
|
||||
) -> Option<PegoutData<'_>> {
|
||||
let pegged_asset_id = network.pegged_asset()?;
|
||||
txout.pegout_data().filter(|pegout| {
|
||||
pegout.asset == Asset::Explicit(*pegged_asset_id)
|
||||
|
||||
@ -40,7 +40,7 @@ impl AssetRegistry {
|
||||
start_index: usize,
|
||||
limit: usize,
|
||||
sorting: AssetSorting,
|
||||
) -> (usize, Vec<AssetEntry>) {
|
||||
) -> (usize, Vec<AssetEntry<'_>>) {
|
||||
let mut assets: Vec<AssetEntry> = self
|
||||
.assets_cache
|
||||
.iter()
|
||||
|
||||
@ -166,11 +166,11 @@ impl DB {
|
||||
self.db.set_options(&opts).unwrap();
|
||||
}
|
||||
|
||||
pub fn raw_iterator(&self) -> rocksdb::DBRawIterator {
|
||||
pub fn raw_iterator(&self) -> rocksdb::DBRawIterator<'_> {
|
||||
self.db.raw_iterator()
|
||||
}
|
||||
|
||||
pub fn iter_scan(&self, prefix: &[u8]) -> ScanIterator {
|
||||
pub fn iter_scan(&self, prefix: &[u8]) -> ScanIterator<'_> {
|
||||
ScanIterator {
|
||||
prefix: prefix.to_vec(),
|
||||
iter: self.db.prefix_iterator(prefix),
|
||||
@ -178,7 +178,7 @@ impl DB {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn iter_scan_from(&self, prefix: &[u8], start_at: &[u8]) -> ScanIterator {
|
||||
pub fn iter_scan_from(&self, prefix: &[u8], start_at: &[u8]) -> ScanIterator<'_> {
|
||||
let iter = self.db.iterator(rocksdb::IteratorMode::From(
|
||||
start_at,
|
||||
rocksdb::Direction::Forward,
|
||||
@ -190,7 +190,7 @@ impl DB {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn iter_scan_reverse(&self, prefix: &[u8], prefix_max: &[u8]) -> ReverseScanIterator {
|
||||
pub fn iter_scan_reverse(&self, prefix: &[u8], prefix_max: &[u8]) -> ReverseScanIterator<'_> {
|
||||
let mut iter = self.db.raw_iterator();
|
||||
iter.seek_for_prev(prefix_max);
|
||||
|
||||
@ -205,7 +205,7 @@ impl DB {
|
||||
&self,
|
||||
prefixes: impl Iterator<Item = (Vec<u8>, Vec<u8>)>,
|
||||
value_offset: usize,
|
||||
) -> ReverseScanGroupIterator {
|
||||
) -> ReverseScanGroupIterator<'_> {
|
||||
let iters = prefixes
|
||||
.map(|(prefix, prefix_max)| {
|
||||
let mut iter = self.db.raw_iterator();
|
||||
|
||||
@ -65,7 +65,7 @@ impl Query {
|
||||
self.config.network_type
|
||||
}
|
||||
|
||||
pub fn mempool(&self) -> RwLockReadGuard<Mempool> {
|
||||
pub fn mempool(&self) -> RwLockReadGuard<'_, Mempool> {
|
||||
self.mempool.read().unwrap()
|
||||
}
|
||||
|
||||
|
||||
@ -609,7 +609,12 @@ impl ChainQuery {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn history_iter_scan(&self, code: u8, hash: &[u8], start_height: usize) -> ScanIterator {
|
||||
pub fn history_iter_scan(
|
||||
&self,
|
||||
code: u8,
|
||||
hash: &[u8],
|
||||
start_height: usize,
|
||||
) -> ScanIterator<'_> {
|
||||
self.store.history_db.iter_scan_from(
|
||||
&TxHistoryRow::filter(code, hash),
|
||||
&TxHistoryRow::prefix_height(code, hash, start_height as u32),
|
||||
@ -620,7 +625,7 @@ impl ChainQuery {
|
||||
code: u8,
|
||||
hash: &[u8],
|
||||
start_height: Option<u32>,
|
||||
) -> ReverseScanIterator {
|
||||
) -> ReverseScanIterator<'_> {
|
||||
self.store.history_db.iter_scan_reverse(
|
||||
&TxHistoryRow::filter(code, hash),
|
||||
&start_height.map_or(TxHistoryRow::prefix_end(code, hash), |start_height| {
|
||||
@ -633,7 +638,7 @@ impl ChainQuery {
|
||||
code: u8,
|
||||
hashes: &[[u8; 32]],
|
||||
start_height: Option<u32>,
|
||||
) -> ReverseScanGroupIterator {
|
||||
) -> ReverseScanGroupIterator<'_> {
|
||||
self.store.history_db.iter_scan_group_reverse(
|
||||
hashes.iter().map(|hash| {
|
||||
let prefix = TxHistoryRow::filter(code, &hash[..]);
|
||||
|
||||
@ -243,7 +243,7 @@ impl HeaderList {
|
||||
self.headers.is_empty()
|
||||
}
|
||||
|
||||
pub fn iter(&self) -> slice::Iter<HeaderEntry> {
|
||||
pub fn iter(&self) -> slice::Iter<'_, HeaderEntry> {
|
||||
self.headers.iter()
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user