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

tests(rpc): add backend blocks tests #1296

Merged
merged 26 commits into from
Sep 5, 2022
Merged

Conversation

danburck
Copy link
Contributor

@danburck danburck commented Aug 24, 2022

Part of #1248

Description

This PR adds unit test coverage for the backend blocks.go. It also improves the method names to better represent their function. The unit tests use mocks for client and JSON-RPC client

Note

I noticed, that the method EthBlockFromTendermintBlock has an open todo to add receipts to the block. Currently this endpoint is not used much, so this should be dealt with in a different PR.

@danburck danburck marked this pull request as draft August 24, 2022 11:25
@codecov
Copy link

codecov bot commented Aug 24, 2022

Codecov Report

Merging #1296 (9ae3458) into main (7bef408) will increase coverage by 1.36%.
The diff coverage is 52.38%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1296      +/-   ##
==========================================
+ Coverage   55.16%   56.53%   +1.36%     
==========================================
  Files         105      105              
  Lines        9608     9609       +1     
==========================================
+ Hits         5300     5432     +132     
+ Misses       4043     3912     -131     
  Partials      265      265              
Impacted Files Coverage Δ
rpc/backend/account_info.go 0.00% <0.00%> (ø)
rpc/backend/backend.go 46.66% <ø> (ø)
rpc/backend/call_tx.go 0.00% <0.00%> (ø)
rpc/backend/chain_info.go 10.05% <0.00%> (ø)
rpc/backend/filters.go 0.00% <0.00%> (ø)
rpc/backend/tracing.go 0.00% <0.00%> (ø)
rpc/backend/tx_info.go 0.00% <0.00%> (ø)
rpc/backend/blocks.go 87.76% <80.48%> (ø)

@danburck danburck changed the title tests(rpc): improve backend coverage tests(rpc): add backend blocks tests Aug 26, 2022
@danburck danburck marked this pull request as ready for review August 26, 2022 10:38
@danburck danburck linked an issue Aug 26, 2022 that may be closed by this pull request
9 tasks
rpc/backend/backend.go Outdated Show resolved Hide resolved
rpc/backend/backend.go Show resolved Hide resolved
rpc/backend/blocks.go Show resolved Hide resolved
rpc/backend/blocks.go Show resolved Hide resolved
@danburck
Copy link
Contributor Author

danburck commented Sep 2, 2022

@facs95 I addressed all the changes as we discussed in a call. Will merge now

@danburck danburck merged commit 9f03ca7 into main Sep 5, 2022
@danburck danburck deleted the 1248-improve-rpc-backend-coverage branch September 5, 2022 14:07
@danburck danburck mentioned this pull request Nov 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve coverage for rpc/backend to 90%
2 participants