Skip to content

Commit

Permalink
NodeJs: add missing utxo routes (#2112)
Browse files Browse the repository at this point in the history
* add missing utxo routes

* Core: rename method to GetOutputManaRewards

* align order, doc fixes

* Python: add account congestion workscore, optionals

* NodeJs: fix more routes and align docs

* fix and order exports

* PR suggestions

Co-authored-by: Thoralf-M <[email protected]>

* Core: rm GetNetworkInfo method

* NodeJs: rm GetNetworkInfo method

* Python: rm GetNetworkInfo method

* PR suggestions 2

Co-authored-by: Thoralf-M <[email protected]>

* Python: = None

* format

---------

Co-authored-by: Thoralf-M <[email protected]>
  • Loading branch information
Alex6323 and Thoralf-M authored Mar 4, 2024
1 parent d2dc74d commit 9578e0e
Show file tree
Hide file tree
Showing 19 changed files with 349 additions and 207 deletions.
6 changes: 2 additions & 4 deletions bindings/core/src/method/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ pub enum ClientMethod {
},
/// Get a node candidate from the healthy node pool.
GetNode,
/// Gets the network related information such as network_id.
GetNetworkInfo,
/// Gets the network id of the node we're connecting to.
GetNetworkId,
/// Returns the bech32_hrp
Expand Down Expand Up @@ -162,7 +160,7 @@ pub enum ClientMethod {
},
/// Returns all the available Mana rewards of an account or delegation output in the returned range of epochs.
#[serde(rename_all = "camelCase")]
GetRewards {
GetOutputManaRewards {
/// Output ID of an account or delegation output.
output_id: OutputId,
/// A client can specify a slot index explicitly, which should be equal to the slot it uses as the commitment
Expand Down Expand Up @@ -205,7 +203,7 @@ pub enum ClientMethod {
/// Post block (raw)
#[serde(rename_all = "camelCase")]
PostBlockRaw {
/// Block
/// Block as raw bytes
block_bytes: Vec<u8>,
},
/// Get block
Expand Down
3 changes: 1 addition & 2 deletions bindings/core/src/method_handler/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ pub(crate) async fn call_client_method_internal(client: &Client, method: ClientM
Response::Ok
}
ClientMethod::GetNode => Response::Node(client.get_node().await?),
ClientMethod::GetNetworkInfo => Response::NetworkInfo(client.get_network_info().await?),
ClientMethod::GetNetworkId => Response::NetworkId(client.get_network_id().await?.to_string()),
ClientMethod::GetBech32Hrp => Response::Bech32Hrp(client.get_bech32_hrp().await?),
ClientMethod::GetProtocolParameters => Response::ProtocolParameters(client.get_protocol_parameters().await?),
Expand All @@ -186,7 +185,7 @@ pub(crate) async fn call_client_method_internal(client: &Client, method: ClientM
ClientMethod::GetAccountCongestion { account_id, work_score } => {
Response::Congestion(client.get_account_congestion(&account_id, work_score).await?)
}
ClientMethod::GetRewards { output_id, slot_index } => {
ClientMethod::GetOutputManaRewards { output_id, slot_index } => {
Response::ManaRewards(client.get_output_mana_rewards(&output_id, slot_index).await?)
}
ClientMethod::GetValidators { page_size, cursor } => {
Expand Down
4 changes: 0 additions & 4 deletions bindings/core/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use iota_sdk::{
api::{PreparedTransactionData, SignedTransactionDataDto},
node_api::core::routes::NodeInfoResponse,
node_manager::node::Node,
NetworkInfo,
},
types::{
api::{
Expand Down Expand Up @@ -71,9 +70,6 @@ pub enum Response {
/// - [`GetNode`](crate::method::ClientMethod::GetNode)
Node(Node),
/// Response for:
/// - [`GetNetworkInfo`](crate::method::ClientMethod::GetNetworkInfo)
NetworkInfo(NetworkInfo),
/// Response for:
/// - [`GetNetworkId`](crate::method::ClientMethod::GetNetworkId)
NetworkId(String),
/// Response for:
Expand Down
Loading

0 comments on commit 9578e0e

Please sign in to comment.