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

Use HexOrNum in ledger RPCs #1535

Merged
merged 9 commits into from
Dec 2, 2024
Merged

Use HexOrNum in ledger RPCs #1535

merged 9 commits into from
Dec 2, 2024

Conversation

jfldde
Copy link
Contributor

@jfldde jfldde commented Nov 28, 2024

Description

  • Accept u64 or hex string as input in ledger RPCs

Linked Issues

Testing

curl -s -X POST -H 'accept: application/json' -H 'content-type: application/json' -d '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_getTransactionReceipt",       
  "params": [
    "0x9c56cd995a89812aa575d691e50a791c83ad62a64416c8e4c64e706b89862b5b"
  ]
}' localhost:12345  | jq ' .result.blockNumber'
"0x1"

curl -s -X POST -H 'accept: application/json' -H 'content-type: application/json' -d '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "ledger_getSoftConfirmationStatus",
  "params": [
    1                                                                   
  ]
}' localhost:12345  | jq                       
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "trusted"
}

curl -s -X POST -H 'accept: application/json' -H 'content-type: application/json' -d '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "ledger_getSoftConfirmationStatus",
  "params": [
    "0x1"                                                               
  ]
}' localhost:12345  | jq                       
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "trusted"
}

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

Attention: Patch coverage is 91.30435% with 4 lines in your changes missing coverage. Please review.

Project coverage is 76.3%. Comparing base (1ebe899) to head (9452e2a).
Report is 1 commits behind head on nightly.

Files with missing lines Patch % Lines
...vereign-sdk/full-node/sov-ledger-rpc/src/server.rs 90.6% 4 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...vereign-sdk/full-node/sov-ledger-rpc/src/client.rs 100.0% <ø> (ø)
.../sovereign-sdk/full-node/sov-ledger-rpc/src/lib.rs 100.0% <100.0%> (ø)
...vereign-sdk/full-node/sov-ledger-rpc/src/server.rs 95.4% <90.6%> (+<0.1%) ⬆️

... and 6 files with indirect coverage changes

@jfldde jfldde merged commit 4ac3098 into nightly Dec 2, 2024
14 of 15 checks passed
@jfldde jfldde deleted the hex-or-num-ledger branch December 2, 2024 11:02
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.

Use hex on ledger_getSoftConfirmationStatus
2 participants