-
Notifications
You must be signed in to change notification settings - Fork 16
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
test: mock HTTPS outcalls in state machine tests #89
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
0a46cd2
Refactor to use same HTTP request logic in JSON- and Candid-RPC endpo…
rvanasa 6761c5f
Set up 'MockOutcall'
rvanasa 1ea698a
Set up HTTPS outcall mocking in state machine tests
rvanasa db29161
Add 'mock' feature to generated Wasm file
rvanasa b59d80a
Misc
rvanasa ec26702
Improve readability of JSON literals
rvanasa 62fa023
Use mocking for both test env and 'mock' flag
rvanasa f447105
Refactor
rvanasa 3d96260
Rename 'MessageFlow' -> 'CallFlow'
rvanasa c17764e
Appease type system
rvanasa cbfef1e
Add 'no pending HTTP request' expect message
rvanasa fbad30d
Add initial cycles to canister in state machine tests
rvanasa d27496c
Implement HTTP request mocking
rvanasa dc7d182
Refactor
rvanasa c3942d6
Simplify HTTP outcall testing logic
rvanasa d1515ac
Merge branch 'main' of https://github.com/internet-computer-protocol/…
rvanasa 6ab1cdd
Remove unused Cargo dependency
rvanasa f8671b9
Reformat
rvanasa 280a274
Fix linter warnings
rvanasa 56fe2fb
Rename local variable
rvanasa e808116
Simplify
rvanasa a4c9135
Merge branch 'main' into mock-https-outcalls
rvanasa c8142a9
Update unit test names
rvanasa 1fcd52e
Update src/http.rs
rvanasa 6626872
Test each individual part of mock HTTPS outcalls
rvanasa bad4f78
Refactor
rvanasa 529351f
Add 'should_request_succeed_with_url' test
rvanasa b2de719
Test JSON canonicalization
rvanasa a75b741
Merge branch 'mock-https-outcalls' of https://github.com/internet-com…
rvanasa c83f855
Adjust HTTPS outcall transform source code
rvanasa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dumb question: why have another name as the method's name (
__ic_evm_transform_json_rpc
vstransform_json_rpc
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code above is from a separate Rust library (in
lib/rust
) which was intended as an alternative to calling the EVM RPC canister. At one point, the canister used this library to perform JSON-RPC requests, but this has changed for the current MVP design.__ic_evm_transform_json_rpc
is provided by theic_evm
library whereas__transform_json_rpc
is specific to the canister. They're essentially doing the same thing, so I used arbitrarily different names to distinguish these from each other. I'd be happy to change the names if we can come up with something better.