Skip to content
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

[trello.com/c/rxAVDtVH]: EthWalletService tests #652

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

ChrisBenua
Copy link
Collaborator

@ChrisBenua ChrisBenua commented Jan 16, 2025

Tests for EthWalletService.

Because Web3Core uses raw URLSession calls for networking, so I've done mocking and tracking request using URLProtocol in MockURLProtocol. I set custom URLSession with custom configuration with MockURLProtocol through Web3ProviderMock. For correct checking request body and response body, added EthRequestBody for request bodies and EthAPIResponse.

To proxy Eth calls, added IEthMock. All default logic of IEth protocol is located in extension: IEth+Defaults, so for calling original implementation added EthDefault class.

PR is opened in branch with tests for BTCWalletService to reduce reviewed diff. After BTCWalletService PR will be merge, I will change branch to develop

@ChrisBenua ChrisBenua self-assigned this Jan 16, 2025
Copy link
Collaborator

@VeretennikovSV VeretennikovSV left a comment

Choose a reason for hiding this comment

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

Looks fine. Some nits here.
Some complex things to comprehend, but generally I understood what's happening

Base automatically changed from dev/trello.com/c/4QaDmVkg to develop January 24, 2025 13:14
@ChrisBenua ChrisBenua force-pushed the dev/trello.com/c/rxAVDtVH branch from bbfc161 to 6e98454 Compare January 24, 2025 20:34
@ChrisBenua ChrisBenua force-pushed the dev/trello.com/c/rxAVDtVH branch from 6e98454 to 79666b9 Compare January 24, 2025 20:35
@ChrisBenua ChrisBenua merged commit 0995f09 into develop Jan 24, 2025
@ChrisBenua ChrisBenua deleted the dev/trello.com/c/rxAVDtVH branch January 24, 2025 20:40
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.

3 participants