Skip to content

fix: return total supply RPC result#48

Open
Luzijano wants to merge 1 commit into
harmony-one:masterfrom
Luzijano:fix-return-total-supply
Open

fix: return total supply RPC result#48
Luzijano wants to merge 1 commit into
harmony-one:masterfrom
Luzijano:fix-return-total-supply

Conversation

@Luzijano

Copy link
Copy Markdown

Summary

  • Return the hmyv2_getTotalSupply RPC result from blockchain.get_total_supply().
  • Add a regression test that mocks the RPC response and verifies the function no longer returns None when result is present.

Why

get_total_supply() indexed the result field but missed the return statement. This made the SDK return None even when the endpoint provided a valid total supply string.

This is a small contribution toward harmony-one/bounties#7, specifically the acceptance criterion to check unexpected None return types for RPCs and add unit coverage.

Validation

  • python3 -m py_compile pyhmy/blockchain.py tests/request-pyhmy/test_blockchain_return_values.py
  • python3 -m pytest -q tests/request-pyhmy/test_blockchain_return_values.py
  • Manual public RPC check: blockchain.get_total_supply(endpoint="https://api.s0.t.hmny.io") returns a total supply string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant