-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
WIP feat: Seth command parity pt. 1 #14
Changes from 16 commits
425b884
072670a
08a856a
5470aad
91000f7
734ae41
a2b43af
8efb216
b6b5953
3314129
4cf8b59
4364e44
fb310df
de1ae44
086ec0c
3d4fc60
db3687b
File filter
Filter by extension
Conversations
Jump to
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,9 +20,24 @@ pub enum Subcommands { | |
#[structopt(name = "--to-checksum-address")] | ||
#[structopt(about = "convert an address to a checksummed format (EIP-55)")] | ||
ToCheckSumAddress { address: Address }, | ||
#[structopt(name = "--to-ascii")] | ||
#[structopt(about = "convert hex data to text data")] | ||
ToAscii { hexdata: String }, | ||
#[structopt(name = "--to-bytes32")] | ||
#[structopt(about = "left-pads a hex bytes string to 32 bytes)")] | ||
ToBytes32 { bytes: String }, | ||
#[structopt(name = "--to-dec")] | ||
#[structopt(about = "convert hex value into decimal number")] | ||
ToDec { hexvalue: String }, | ||
#[structopt(name = "--to-fix")] | ||
#[structopt(about = "convert integers into fixed point with specified decimals")] | ||
ToFix { decimals: Option<u128>, value: Option<u128> }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I tested OG seth and you can only do |
||
#[structopt(name = "--to-uint256")] | ||
#[structopt(about = "convert a number into uint256 hex string with 0x prefix")] | ||
ToUint256 { value: String }, | ||
#[structopt(name = "--to-wei")] | ||
#[structopt(about = "convert an ETH amount into wei")] | ||
ToWei { value: Option<u128>, unit: Option<String> }, | ||
#[structopt(name = "block")] | ||
#[structopt( | ||
about = "Prints information about <block>. If <field> is given, print only the value of that field" | ||
|
@@ -38,6 +53,12 @@ pub enum Subcommands { | |
#[structopt(long, env = "ETH_RPC_URL")] | ||
rpc_url: String, | ||
}, | ||
#[structopt(name = "block-number")] | ||
#[structopt(about = "Prints latest block number")] | ||
BlockNumber { | ||
#[structopt(long, env = "ETH_RPC_URL")] | ||
rpc_url: String, | ||
}, | ||
#[structopt(name = "call")] | ||
#[structopt(about = "Perform a local call to <to> without publishing a transaction.")] | ||
Call { | ||
|
@@ -48,6 +69,21 @@ pub enum Subcommands { | |
#[structopt(long, env = "ETH_RPC_URL")] | ||
rpc_url: String, | ||
}, | ||
#[structopt(name = "chain")] | ||
#[structopt(about = "Prints symbolic name of current blockchain by checking genesis hash")] | ||
Chain { | ||
#[structopt(long, env = "ETH_RPC_URL")] | ||
rpc_url: String, | ||
}, | ||
#[structopt(name = "chain-id")] | ||
#[structopt(about = "returns ethereum chain id")] | ||
ChainId { | ||
#[structopt(long, env = "ETH_RPC_URL")] | ||
rpc_url: String, | ||
}, | ||
#[structopt(name = "namehash")] | ||
#[structopt(about = "returns ENS namehash of provided name")] | ||
Namehash { name: String }, | ||
#[structopt(name = "send")] | ||
#[structopt(about = "Publish a transaction signed by <from> to call <to> with <data>")] | ||
SendTx { | ||
|
@@ -60,6 +96,14 @@ pub enum Subcommands { | |
#[structopt(flatten)] | ||
eth: EthereumOpts, | ||
}, | ||
#[structopt(name = "age")] | ||
#[structopt(about = "Prints the timestamp of a block")] | ||
Age { | ||
#[structopt(global = true, help = "the block you want to query, can also be earliest/latest/pending", parse(try_from_str = parse_block_id))] | ||
block: Option<BlockId>, | ||
#[structopt(short, long, env = "ETH_RPC_URL")] | ||
rpc_url: String, | ||
}, | ||
#[structopt(name = "balance")] | ||
#[structopt(about = "Print the balance of <account> in wei")] | ||
Balance { | ||
|
@@ -70,6 +114,23 @@ pub enum Subcommands { | |
#[structopt(short, long, env = "ETH_RPC_URL")] | ||
rpc_url: String, | ||
}, | ||
#[structopt(name = "basefee")] | ||
#[structopt(about = "Print the basefee of a block")] | ||
BaseFee { | ||
#[structopt(global = true, help = "the block you want to query, can also be earliest/latest/pending", parse(try_from_str = parse_block_id))] | ||
block: Option<BlockId>, | ||
#[structopt(short, long, env = "ETH_RPC_URL")] | ||
rpc_url: String, | ||
}, | ||
#[structopt(name = "gas-price")] | ||
#[structopt(about = "Prints current gas price of target chain")] | ||
GasPrice { | ||
#[structopt(short, long, env = "ETH_RPC_URL")] | ||
rpc_url: String, | ||
}, | ||
#[structopt(name = "keccak")] | ||
#[structopt(about = "Keccak-256 hashes arbitrary data")] | ||
Keccak { data: String }, | ||
#[structopt(name = "resolve-name")] | ||
#[structopt(about = "Returns the address the provided ENS name resolves to")] | ||
ResolveName { | ||
|
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.
Double stdin args don't work I believe, so best to make the first argument the stdin one, to be consistent with seth.