Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix: error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko Atanasievski committed Jan 9, 2024
1 parent 848c642 commit 45d4dc0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
8 changes: 4 additions & 4 deletions crates/topos-sequencer-subnet-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ impl SubnetClientListener {
Err(Error::EventDecodingError(e)) => {
// FIXME: Happens in block before subnet contract is deployed, seems like bug in ethers
error!(
"Error decoding events from block {}: {e} \nTopos smart contracts may not be \
deployed?",
"Error decoding events from block {}: {e}. Topos smart contracts may not be \
deployed before the parsed block?",
block_number
);
Vec::new()
Expand Down Expand Up @@ -221,8 +221,8 @@ impl SubnetClientListener {
Err(Error::EventDecodingError(e)) => {
// FIXME: Happens in block before subnet contract is deployed, seems like bug in ethers
error!(
"Error decoding events from block {}: {e} \nTopos smart contracts may not \
be deployed?",
"Error decoding events from block {}: {e}. Topos smart contracts may not \
be deployed before the parsed block?",
block_number
);
Vec::new()
Expand Down
15 changes: 14 additions & 1 deletion crates/topos-sequencer-subnet-runtime/tests/subnet_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,12 @@ async fn deploy_test_token(
.event::<abi::ierc20_messaging::TokenDeployedFilter>()
.from_block(0);
let events = events.query().await?;
if events.is_empty() {
panic!(
"Missing TokenDeployed event. Token contract is not deployed to test subnet. Could \
not execute test"
);
}
let token_address = events[0].token_address;
info!("Token contract deployed to {}", token_address.to_string());

Expand Down Expand Up @@ -432,7 +438,14 @@ async fn context_running_subnet_node(
let subnet_node_handle = match spawn_subnet_node(port, block_time) {
Ok(subnet_node_handle) => subnet_node_handle,
Err(e) => {
panic!("Failed to start the subnet node as part of test context: {e}");
if e.kind() == std::io::ErrorKind::NotFound {
panic!(
"Could not find Anvil binary. Please install and add to path Foundy tools \
including Anvil"
);
} else {
panic!("Failed to start the Anvil subnet node as part of test context: {e}");
}
}
};
// Wait a bit for anvil subprocess to spin itself up
Expand Down

0 comments on commit 45d4dc0

Please sign in to comment.