Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first signet inscription height #1016

Merged
merged 5 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ impl Chain {
match self {
Self::Mainnet => 767430,
Self::Regtest => 0,
Self::Signet => 112402,
Self::Testnet => 0,
Self::Signet => 0,
}
}

Expand Down
12 changes: 8 additions & 4 deletions src/index/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ impl Updater {
let client =
Client::new(&index.rpc_url, index.auth.clone()).context("failed to connect to RPC URL")?;

let chain = index.chain;
let first_inscription_height = if integration_test() {
0
} else {
index.chain.first_inscription_height()
};

thread::spawn(move || loop {
if let Some(height_limit) = height_limit {
Expand All @@ -175,7 +179,7 @@ impl Updater {
}
}

match Self::get_block_with_retries(&client, height, index_sats, chain) {
match Self::get_block_with_retries(&client, height, index_sats, first_inscription_height) {
Ok(Some(block)) => {
if let Err(err) = tx.send(block.into()) {
log::info!("Block receiver disconnected: {err}");
Expand All @@ -198,7 +202,7 @@ impl Updater {
client: &Client,
height: u64,
index_sats: bool,
chain: Chain,
first_inscription_height: u64,
) -> Result<Option<Block>> {
let mut errors = 0;
loop {
Expand All @@ -208,7 +212,7 @@ impl Updater {
.and_then(|option| {
option
.map(|hash| {
if index_sats || height >= chain.first_inscription_height() {
if index_sats || height >= first_inscription_height {
Ok(client.get_block(&hash)?)
} else {
Ok(Block {
Expand Down
1 change: 1 addition & 0 deletions tests/command_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ impl CommandBuilder {
}

command
.env("ORD_INTEGRATION_TEST", "1")
.stdin(Stdio::null())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
Expand Down