Skip to content

Test APIs that changes the wallet balance/history #88

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

Closed
thr0wn opened this issue Mar 19, 2021 · 1 comment
Closed

Test APIs that changes the wallet balance/history #88

thr0wn opened this issue Mar 19, 2021 · 1 comment

Comments

@thr0wn
Copy link
Contributor

thr0wn commented Mar 19, 2021

Some tests require mocking WebSocket messages sent from the full node. When melting tokens, for example, the following happens:

hathor-wallet-headless -> POST push_tx -> hathor-core
hathor-wallet-headless <- POST push_tx 200 OK <- hathor-core
hathor-wallet-headless <- websocket message with type: "wallet:address_history" <- hathor-core

Although the PR #69 can handle the push_tx successfully, it does not change the wallet history, so no assertion to verify balance changes can be done. To do so, it is necessary to mock websocket messages with something like this skipped test. The test was skipped due to not work as expected, but it may help future efforts to test APIs that affect the wallet balance/history.

That said, some strategy to test websocket messages must be done to test the following cases:

  1. Assert that simple-send-tx/send-tx/create-token/mint-token/melt-token correctly changes the wallet balance.
  2. Assert that /wallet/utxo-consolidation consolidates utxos without affecting the wallet balance.
@thr0wn thr0wn mentioned this issue Mar 19, 2021
3 tasks
@tuliomir
Copy link
Contributor

tuliomir commented Apr 8, 2022

This has been implemented on #149 , #152 and #164

@tuliomir tuliomir closed this as completed Apr 8, 2022
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

No branches or pull requests

2 participants