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

Add CLI for query evm tx by hash #2053

Merged
merged 8 commits into from
Jan 27, 2025
Merged

Add CLI for query evm tx by hash #2053

merged 8 commits into from
Jan 27, 2025

Conversation

yzang2019
Copy link
Contributor

Describe your changes and provide context

This PR add a new command line to query evm tx by hash.

Testing performed to validate your change

Tested on pacific-1 rpc node:

For valid tx hash:

root@ip-172-31-44-225:/home/ubuntu/sei-chain# seid q evm tx 0x33ced5c43f22e91098dce35daf39e5135388d8f504bb2b0549c30a525b16342d
{
  "blockHash": "0x8cfec4c1f76654e2131dc328254d102b6ef72471a0ee97d59b69c272d5581f9f",
  "blockNumber": "0x7a00a50",
  "from": "0xe874bb797c1d5390787cb880b09029334974a56a",
  "gas": "0x5208",
  "gasPrice": "0x441e0025",
  "maxFeePerGas": "0x441e0025",
  "maxPriorityFeePerGas": "0x441e0025",
  "hash": "0x33ced5c43f22e91098dce35daf39e5135388d8f504bb2b0549c30a525b16342d",
  "input": "0x",
  "nonce": "0x4dcc2",
  "to": "0x9b8615a50fec641f3177f8a897b5317f7bc97358",
  "transactionIndex": "0x1f",
  "value": "0x38d7ea4c68000",
  "type": "0x2",
  "accessList": [],
  "chainId": "0x531",
  "v": "0x0",
  "r": "0xe3cbe38928beb507a9237b6fa2e26fd8965867a4d0f16c08a5d948db84ffb7fd",
  "s": "0xf4ed2ec90da7e91f09206591250657b368eccffb25c3db4921c133a72e6bf2b",
  "yParity": "0x0"
}

For invalid tx hash:

root@ip-172-31-44-225:/home/ubuntu/sei-chain# seid q evm tx 0x33ced5c43f22e91098dce35daf39e5135388d8f504bb2b0549c30a5
Error: not found
Usage:
  seid query evm tx [hash] [flags]

Flags:
      --evm-rpc string   RPC endpoint to send request to (default "http://0.0.0.0:8545")
  -h, --help             help for tx

Global Flags:
      --chain-id string     The network chain ID
      --home string         directory for config and data (default "/root/.sei")
      --log_format string   The logging format (json|plain)
      --log_level string    The logging level (trace|debug|info|warn|error|fatal|panic)
      --trace               print out full stack trace on errors


x/evm/client/cli/query.go Fixed Show fixed Hide fixed
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.51%. Comparing base (2418932) to head (b17b741).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2053      +/-   ##
==========================================
- Coverage   61.53%   61.51%   -0.02%     
==========================================
  Files         264      264              
  Lines       24589    24589              
==========================================
- Hits        15131    15127       -4     
- Misses       8328     8331       +3     
- Partials     1130     1131       +1     

see 3 files with indirect coverage changes

@yzang2019 yzang2019 enabled auto-merge (squash) January 27, 2025 02:21
@yzang2019 yzang2019 merged commit eeb164d into main Jan 27, 2025
49 checks passed
@yzang2019 yzang2019 deleted the yzang/SEI-8856 branch January 27, 2025 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants