-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
70 additions
and
81 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#[cfg(feature = "rpc")] | ||
mod rpc; | ||
mod utils; | ||
|
||
use clap::Parser; | ||
use color_eyre::Result; | ||
use rika_args::commands::utility; | ||
|
||
#[derive(Parser, Debug)] | ||
#[command(name = "rika", version, about, long_about = None)] | ||
pub enum Cli { | ||
#[command(flatten)] | ||
Utilities(utility::UtilityCommands), | ||
|
||
#[cfg(feature = "rpc")] | ||
#[command(flatten)] | ||
Rpc(rpc::RpcCommands), | ||
} | ||
|
||
impl Cli { | ||
pub fn execute(self) -> Result<()> { | ||
match self { | ||
Cli::Utilities(cmd) => utils::execute(cmd)?, | ||
#[cfg(feature = "rpc")] | ||
Cli::Rpc(rpc) => rpc::execute(rpc)?, | ||
} | ||
Ok(()) | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use color_eyre::Result; | ||
pub use rika_args::commands::rpc::RpcCommands; | ||
use rika_ops as ops; | ||
|
||
pub fn execute(command: RpcCommands) -> Result<()> { | ||
match command { | ||
// RpcCommands::Call(args) => ops::rpc::call::call(args)?, | ||
// RpcCommands::Balance(args) => ops::rpc::balance::get(args)?, | ||
// RpcCommands::Tx(args) => ops::rpc::transaction::get(args)?, | ||
// RpcCommands::TxCount(args) => ops::rpc::transaction::count(args)?, | ||
// RpcCommands::TxStatus(args) => ops::rpc::transaction::status(args)?, | ||
RpcCommands::Receipt(args) => ops::rpc::transaction::receipt(args)?, | ||
// RpcCommands::Rpc(args) => ops::rpc::raw::send(args)?, | ||
// RpcCommands::Block(args) => ops::rpc::block::get(args)?, | ||
// RpcCommands::Age(args) => ops::rpc::block::age(args)?, | ||
// RpcCommands::BlockNumber(args) => ops::rpc::block::number(args)?, | ||
// RpcCommands::ChainId(args) => ops::rpc::chain::id(args)?, | ||
// RpcCommands::Syncing(args) => ops::rpc::chain::syncing(args)?, | ||
_ => { | ||
unimplemented!("This command is not implemented yet") | ||
} | ||
} | ||
|
||
Ok(()) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use color_eyre::Result; | ||
pub use rika_args::commands::utility::UtilityCommands; | ||
use rika_ops as ops; | ||
|
||
pub fn execute(command: UtilityCommands) -> Result<()> { | ||
match command { | ||
UtilityCommands::Index(args) => ops::utility::storage_address(args)?, | ||
_ => unimplemented!("This command is not implemented yet"), | ||
} | ||
|
||
Ok(()) | ||
} |
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