Skip to content

Commit

Permalink
Add getNetwork to soroban serve for consistency (#386)
Browse files Browse the repository at this point in the history
* Add getNetwork to soroban serve for consistency

* Fix rust

* Appease clippy
  • Loading branch information
Paul Bellamy authored Feb 6, 2023
1 parent 0c67851 commit 72db26e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/soroban-cli/src/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ async fn handler(
("getAccount", Some(Requests::StringArg(b))) => get_account(b),
("getHealth", Some(Requests::NoArg()) | None) => Ok(get_health()),
("getLedgerEntry", Some(Requests::StringArg(key))) => get_ledger_entry(key, &ledger_file),
("getNetwork", Some(Requests::NoArg())) => Ok(get_network()),
("getTransactionStatus", Some(Requests::StringArg(b))) => {
get_transaction_status(&transaction_status_map, b).await
}
Expand Down Expand Up @@ -215,6 +216,13 @@ fn get_ledger_entry(k: Box<[String]>, ledger_file: &PathBuf) -> Result<Value, Er
}
}

fn get_network() -> Value {
json!({
"passphrase": SANDBOX_NETWORK_PASSPHRASE,
"protocolVersion": 20,
})
}

fn parse_transaction(
txn_xdr: &str,
passphrase: &str,
Expand Down

0 comments on commit 72db26e

Please sign in to comment.