-
Notifications
You must be signed in to change notification settings - Fork 134
[REFACTOR][RPC] Centralize RPC traits and method names #1067
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
base: master
Are you sure you want to change the base?
Changes from all commits
c6b5215
bd3fa59
6417375
6a576ee
d86609b
67b29ae
167b5c2
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 |
|---|---|---|
|
|
@@ -10,7 +10,11 @@ use bitcoin::Txid; | |
| use clap::Parser; | ||
| use clap::Subcommand; | ||
| use floresta_rpc::jsonrpc_client::Client; | ||
| use floresta_rpc::rpc::FlorestaRPC; | ||
| use floresta_rpc::rpc_interfaces::BlockchainRpc; | ||
| use floresta_rpc::rpc_interfaces::ControlRpc; | ||
| use floresta_rpc::rpc_interfaces::NetworkRpc; | ||
| use floresta_rpc::rpc_interfaces::RawTransactionRpc; | ||
| use floresta_rpc::rpc_interfaces::WalletRpc; | ||
| use floresta_rpc::rpc_types::AddNodeCommand; | ||
| use floresta_rpc::rpc_types::RescanConfidence; | ||
|
|
||
|
|
@@ -63,24 +67,24 @@ fn do_request(cmd: &Cli, client: Client) -> anyhow::Result<String> { | |
| Methods::GetBestBlockHash => serde_json::to_string_pretty(&client.get_best_block_hash()?)?, | ||
| Methods::GetBlockCount => serde_json::to_string_pretty(&client.get_block_count()?)?, | ||
| Methods::GetTxOut { txid, vout } => { | ||
| serde_json::to_string_pretty(&client.get_tx_out(txid, vout)?)? | ||
| serde_json::to_string_pretty(&client.get_tx_out(txid, vout, false)?)? | ||
|
Member
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. What's this false for? |
||
| } | ||
| Methods::GetTxOutProof { txids, blockhash } => { | ||
| serde_json::to_string_pretty(&client.get_txout_proof(txids, blockhash))? | ||
| serde_json::to_string_pretty(&client.get_txout_proof(&txids, blockhash)?)? | ||
| } | ||
| Methods::GetTransaction { txid, .. } => { | ||
| serde_json::to_string_pretty(&client.get_transaction(txid, Some(true))?)? | ||
| Methods::GetTransaction { txid, verbose } => { | ||
| serde_json::to_string_pretty(&client.get_raw_transaction(txid, verbose)?)? | ||
| } | ||
| Methods::RescanBlockchain { | ||
| start_block, | ||
| stop_block, | ||
| use_timestamp, | ||
| confidence, | ||
| } => serde_json::to_string_pretty(&client.rescanblockchain( | ||
| } => serde_json::to_string_pretty(&client.rescan_blockchain( | ||
| Some(start_block), | ||
| Some(stop_block), | ||
| use_timestamp, | ||
| confidence, | ||
| Some(confidence), | ||
| )?)?, | ||
| Methods::SendRawTransaction { tx } => { | ||
| serde_json::to_string_pretty(&client.send_raw_transaction(tx)?)? | ||
|
|
@@ -215,7 +219,7 @@ pub enum Methods { | |
|
|
||
| /// Returns the transaction, assuming it is cached by our watch only wallet | ||
| #[command(name = "gettransaction")] | ||
| GetTransaction { txid: Txid, verbose: Option<bool> }, | ||
| GetTransaction { txid: Txid, verbose: Option<u32> }, | ||
|
Member
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.
|
||
|
|
||
| #[doc = include_str!("../../../doc/rpc/rescanblockchain.md")] | ||
| #[command( | ||
|
|
@@ -362,7 +366,7 @@ pub enum Methods { | |
| )] | ||
| DisconnectNode { | ||
| node_address: String, | ||
| node_id: Option<usize>, | ||
| node_id: Option<u32>, | ||
| }, | ||
|
|
||
| #[command(name = "findtxout")] | ||
|
|
||
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.
Hmm, we need to make sure we can build docs for https://docs.gefloresta.sh