Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/okx/ord into pending2
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsFunny committed Jan 31, 2024
2 parents e2fa574 + 05b0f5e commit beb24c4
Show file tree
Hide file tree
Showing 21 changed files with 957 additions and 949 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev

defaults:
run:
Expand Down Expand Up @@ -97,9 +99,9 @@ jobs:
strategy:
matrix:
os:
- macos-latest
# - macos-latest
- ubuntu-latest
- windows-latest
# - windows-latest

runs-on: ${{matrix.os}}

Expand Down
2 changes: 1 addition & 1 deletion bin/forbid
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ which rg > /dev/null
--glob '!docs/src/bounty/frequency.tsv' \
--glob '!docs/po/*' \
--ignore-case \
'dbg!|fixme|todo|xxx' \
'dbg!|fixme|xxx' \
.
11 changes: 4 additions & 7 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ impl Index {
if let Some(height) = ord_height {
if query_btc {
let btc_height = match self.client.get_blockchain_info() {
Ok(info) => Height(info.headers as u32),
Ok(info) => Height(u32::try_from(info.headers).unwrap()),
Err(e) => {
return Err(anyhow!(
"failed to get blockchain info from bitcoin node: {}",
Expand Down Expand Up @@ -2259,7 +2259,7 @@ impl Index {
if let Some(tx_blockhash) = tx.blockhash {
let tx_bh = self.client.get_block_header_info(&tx_blockhash)?;
let parsed_height = self.block_height()?;
if parsed_height.is_none() || tx_bh.height as u32 > parsed_height.unwrap().0 {
if parsed_height.is_none() || u32::try_from(tx_bh.height)? > parsed_height.unwrap().0 {
return Ok(None);
}
} else {
Expand Down Expand Up @@ -2317,10 +2317,7 @@ impl Index {
) -> Result<Vec<brc20::Balance>> {
let rtx = self.database.begin_read().unwrap();
let table = rtx.open_table(BRC20_BALANCES)?;
Ok(get_balances(
&table,
&ScriptKey::from_address(address.clone()),
)?)
get_balances(&table, &ScriptKey::from_address(address.clone()))
}

pub(crate) fn brc20_get_tx_events_by_txid(
Expand All @@ -2336,7 +2333,7 @@ impl Index {
if let Some(tx_blockhash) = tx.blockhash {
let tx_bh = self.client.get_block_header_info(&tx_blockhash)?;
let parsed_height = self.begin_read()?.block_height()?;
if parsed_height.is_none() || tx_bh.height as u32 > parsed_height.unwrap().0 {
if parsed_height.is_none() || u32::try_from(tx_bh.height)? > parsed_height.unwrap().0 {
return Ok(None);
}
} else {
Expand Down
3 changes: 3 additions & 0 deletions src/index/simulator/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
pub mod error;
#[allow(clippy::needless_return)]
#[allow(clippy::map_identity)]
#[allow(clippy::unnecessary_cast)]
pub mod processor;
pub mod simulate;
pub mod types;
Loading

0 comments on commit beb24c4

Please sign in to comment.