Skip to content

feat: update getBalance method to require blockNumberOrTagOrHash parameter instead of allowing null (#3838) #3859

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mwb-al
Copy link
Contributor

@mwb-al mwb-al commented Jun 17, 2025

Description:

Updated getBalance method and related tests to accommodate parameter type change from string | null to string.

Related issue(s):

Fixes #3838

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

…parameter instead of allowing null (hiero-ledger#3838)

Signed-off-by: Michał Walczak <michal.walczak@arianelabs.com>
@mwb-al mwb-al requested review from a team as code owners June 17, 2025 10:21
@mwb-al mwb-al requested a review from Ferparishuertas June 17, 2025 10:21
@lfdt-bot
Copy link

lfdt-bot commented Jun 17, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

Copy link
Contributor

@acuarica acuarica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM looks like unit tests need some updates as well

@@ -91,12 +91,12 @@ export class AccountService implements IAccountService {
* Current implementation does not yet utilize blockNumber
*
* @param {string} account The account to get the balance from
* @param {string | null} blockNumberOrTagOrHash The block number or tag or hash to get the balance from
* @param {string} blockNumberOrTagOrHash The block number or tag or hash to get the balance from

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thibk we should a test to enforce required. Somethin like cannot be bull, blockNumberOrTagOrHashIsRequired

Copy link

codecov bot commented Jun 25, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...rvices/ethService/accountService/AccountService.ts 0.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (50.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

@@           Coverage Diff           @@
##             main    #3859   +/-   ##
=======================================
  Coverage        ?   41.29%           
=======================================
  Files           ?       83           
  Lines           ?     4770           
  Branches        ?      970           
=======================================
  Hits            ?     1970           
  Misses          ?     2536           
  Partials        ?      264           
Files with missing lines Coverage Δ
packages/relay/src/lib/eth.ts 49.11% <100.00%> (ø)
...rvices/ethService/accountService/AccountService.ts 19.29% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Align eth_getBalance parameter validation with Ethereum's OpenRPC specification
5 participants