-
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
feat!: adjust Candid-RPC methods for state machine tests #95
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
8d382af
Progress
rvanasa 6ae1643
Fix formatting
rvanasa cf07d3b
Add specific error message when decoding Candid response from update …
rvanasa c64d3e9
Add equivalent error message for query call
rvanasa 9f9711a
Derive 'PartialEq' and 'Eq' for Candid-RPC types
rvanasa 76cdd8b
Use latest 'evm-rpc' branch
rvanasa 1a2c1ff
Fix JSON
rvanasa 756faa4
Update Candid interface
rvanasa 56ab8f0
Test 'eth_get_transaction_count'
rvanasa 1239df9
Misc
rvanasa a77742a
Add 'should_decode_checked_amount' test
rvanasa a86e11c
Reformat test JSON strings
rvanasa c14a96c
Reorganize tests
rvanasa 2339733
Use camelCase for all fields in Candid interface
rvanasa da42bac
Use original Ethereum RPC method naming convention
rvanasa cff2565
Update 'examples' script
rvanasa e89d9b4
Merge branch 'main' of https://github.com/internet-computer-protocol/…
rvanasa 602c36e
Update Motoko E2E test
rvanasa 4d903bb
Update method names in state machine tests
rvanasa b33901f
Update canister method names to Motoko convention
rvanasa 5fadbe2
Fix
rvanasa 6d9f180
Rename Candid methods
rvanasa 73c84b1
Regenerate Candid interface
rvanasa 859e044
Update Rust E2E test
rvanasa 465e54e
Update method names
rvanasa ce4f834
Update 'eth_getTransactionCount' test
rvanasa 55944e5
Fix 'eth_get_logs' test
rvanasa 003f14f
Refactor for repeated mock HTTP scenarios
rvanasa c526f92
Test 'eth_feeHistory' and 'eth_sendRawTransaction'
rvanasa fe5ef5f
Update 'examples' script
rvanasa 83edfb3
Misc
rvanasa af7aae4
Fix Candid decoding for 'TransactionStatus'
rvanasa 78ce8c9
Update Cargo.lock
rvanasa 20d572c
Add all fields to 'eth_feeHistory' test
rvanasa 6bb7493
Add all fields to 'eth_getLogs' test
rvanasa e88b65d
Rename param 'cycles' -> 'cycles_cost' for clarity
rvanasa fcb1398
Add fail case tests
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
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
#!/usr/bin/env bash | ||
# Redeploy the canister and set up permissions in your local environment. | ||
|
||
CANISTER_ID=evm_rpc | ||
PRINCIPAL=$(dfx identity get-principal) | ||
|
||
dfx deploy evm_rpc --mode reinstall -y | ||
# dfx canister call evm_rpc authorize "(principal \"$PRINCIPAL\", variant { Rpc })" | ||
dfx canister call evm_rpc authorize "(principal \"$PRINCIPAL\", variant { RegisterProvider })" | ||
|
||
dfx canister call evm_rpc register_provider '(record {hostname = "cloudflare-eth.com"; credential_path = "/v1/mainnet"; chain_id = 1; cycles_per_call = 1000; cycles_per_message_byte = 100})' | ||
dfx deploy $CANISTER_ID --mode reinstall -y | ||
dfx canister call $CANISTER_ID authorize "(principal \"$PRINCIPAL\", variant { RegisterProvider })" | ||
|
||
dfx canister call evm_rpc request_cost '(variant {Chain=1}, "{ \"jsonrpc\": \"2.0\", \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x2244\", true], \"id\": 1 }", 1000)' | ||
dfx canister call evm_rpc request '(variant {Chain=1}, "{ \"jsonrpc\": \"2.0\", \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x2244\", true], \"id\": 1 }", 1000)' | ||
dfx canister call $CANISTER_ID registerProvider '(record {hostname = "cloudflare-eth.com"; credentialPath = "/v1/mainnet"; chainId = 1; cyclesPerCall = 1000; cyclesPerMessageByte = 100})' | ||
|
||
dfx canister call evm_rpc request_cost '(variant {Provider=0}, "{ \"jsonrpc\": \"2.0\", \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x2244\", true], \"id\": 1 }", 1000)' | ||
dfx canister call evm_rpc request '(variant {Provider=0}, "{ \"jsonrpc\": \"2.0\", \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x2244\", true], \"id\": 1 }", 1000)' | ||
dfx canister call $CANISTER_ID requestCost '(variant {Chain=1}, "{ \"jsonrpc\": \"2.0\", \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x2244\", true], \"id\": 1 }", 1000)' | ||
dfx canister call $CANISTER_ID request '(variant {Chain=1}, "{ \"jsonrpc\": \"2.0\", \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x2244\", true], \"id\": 1 }", 1000)' | ||
|
||
dfx canister call $CANISTER_ID requestCost '(variant {Provider=0}, "{ \"jsonrpc\": \"2.0\", \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x2244\", true], \"id\": 1 }", 1000)' | ||
dfx canister call $CANISTER_ID request '(variant {Provider=0}, "{ \"jsonrpc\": \"2.0\", \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x2244\", true], \"id\": 1 }", 1000)' |
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.
The cycles payment logic was originally in the forked ckETH codebase; I moved it here to support the
FreeRpc
authorization for Candid-RPC methods. Everything else works the same as before.