Skip to content

Commit

Permalink
Merge branch 'main' of github.com:lambdaclass/era-test-node into yul-…
Browse files Browse the repository at this point in the history
…console-log-vm-fixes
  • Loading branch information
ilitteri committed Nov 12, 2023
2 parents 437fb53 + eadb3a1 commit 81c6288
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ jobs:
uses: actions/configure-pages@v3

- name: Install mdbook
run: cargo +nightly install mdbook
run: cargo install mdbook

- name: Generate rust docs
run: |
echo "Generating docs..."
cargo +nightly doc --no-deps
cargo doc --no-deps
- name: Make index.html
run: echo '<!DOCTYPE HTML>
<html lang="en-US">
Expand Down
File renamed without changes.
22 changes: 12 additions & 10 deletions src/node/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ impl<S: ForkSource + std::fmt::Debug + Clone + Send + Sync + 'static> EthNamespa

Ok(Some(block))
}
None => Err(into_jsrpc_error(Web3Error::NoBlock)),
None => Ok(None),
}
})
}
Expand Down Expand Up @@ -451,7 +451,7 @@ impl<S: ForkSource + std::fmt::Debug + Clone + Send + Sync + 'static> EthNamespa

Ok(Some(block))
}
None => Err(into_jsrpc_error(Web3Error::NoBlock)),
None => Ok(None),
}
})
}
Expand Down Expand Up @@ -1365,13 +1365,15 @@ mod tests {
}

#[tokio::test]
async fn test_get_block_by_hash_produces_no_block_error_for_non_existing_block() {
async fn test_get_block_by_hash_returns_none_for_non_existing_block() {
let node = InMemoryNode::<HttpForkSource>::default();

let expected_err = into_jsrpc_error(Web3Error::NoBlock);
let result = node.get_block_by_hash(H256::repeat_byte(0x01), false).await;
let result = node
.get_block_by_hash(H256::repeat_byte(0x01), false)
.await
.expect("failed fetching block by hash");

assert_eq!(expected_err, result.unwrap_err());
assert!(result.is_none());
}

#[tokio::test]
Expand Down Expand Up @@ -1514,15 +1516,15 @@ mod tests {
}

#[tokio::test]
async fn test_get_block_by_number_produces_no_block_error_for_non_existing_block() {
async fn test_get_block_by_number_returns_none_for_non_existing_block() {
let node = InMemoryNode::<HttpForkSource>::default();

let expected_err = into_jsrpc_error(Web3Error::NoBlock);
let result = node
.get_block_by_number(BlockNumber::Number(U64::from(42)), false)
.await;
.await
.expect("failed fetching block by number");

assert_eq!(expected_err, result.unwrap_err());
assert!(result.is_none());
}

#[tokio::test]
Expand Down

0 comments on commit 81c6288

Please sign in to comment.