From f795948d2f8ed1d4f05455090406b556bb6a8572 Mon Sep 17 00:00:00 2001 From: Pi Lanningham Date: Sun, 5 Feb 2023 06:13:06 -0500 Subject: [PATCH] docs: Small crate readme tweaks * Fix a few small typos in the txsubmission readme * Link to txsubmission readme from crate readme * Other small tweaks --- pallas-miniprotocols/README.md | 18 +++++++++--------- .../src/txsubmission/README.md | 11 +++++------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/pallas-miniprotocols/README.md b/pallas-miniprotocols/README.md index 2943bf9..991b06f 100644 --- a/pallas-miniprotocols/README.md +++ b/pallas-miniprotocols/README.md @@ -12,15 +12,15 @@ The following architectural decisions were made for this particular Rust impleme ## Development Status -| mini-protocol | initiator | responder | -| ------------------- | --------- | --------- | -| block-fetch | done | planned | -| chain-sync | done | planned | -| handshake | done | planned | -| local-state | done | planned | -| tx-submission | planned | minimal | -| local tx monitor | done | planned | -| local-tx-submission | ongoing | planned | +| mini-protocol | initiator | responder | +| ------------------------------------------------- | --------- | --------- | +| block-fetch | done | planned | +| chain-sync | done | planned | +| handshake | done | planned | +| local-state | done | planned | +| [tx-submission](src/txsubmission/README.md) | done | done | +| local tx monitor | done | planned | +| local-tx-submission | ongoing | planned | ## Implementation Details diff --git a/pallas-miniprotocols/src/txsubmission/README.md b/pallas-miniprotocols/src/txsubmission/README.md index ff4d93f..e523113 100644 --- a/pallas-miniprotocols/src/txsubmission/README.md +++ b/pallas-miniprotocols/src/txsubmission/README.md @@ -161,7 +161,7 @@ And wait for a response You can download those transactions with ```rust -server.request_txs(ids.iter().map(|tx_and_size| tx_and_size.0).collect()); +server.request_txs(ids.iter().map(|tx_and_size| tx_and_size.0.clone()).collect()); ``` After you receive some transaction Ids, if you request more you should acknowledge the ones you received @@ -175,20 +175,19 @@ All-together, this event loop could look something like this: ```rust let mut server = txsubmission::Server::new(channel4); server.wait_for_init()?; - let mut previous_count = 0; - server.acknowledge_and_request_ids(true, previous_count, 16); + server.acknowledge_and_request_ids(true, 0, 16)?; loop { match server.receive_next_reply()? { Reply::TxIds(ids_and_sizes) => { - server.request_txs(ids_and_sizes.iter().map(|tx| tx.0).collect())?; + server.request_txs(ids_and_sizes.iter().map(|tx| tx.0.clone()).collect())?; }, Reply::Txs(txs) => { tx_channel.send(txs); - server.acknowledge_and_request_ids(true, txs.len(), 16)?; + server.acknowledge_and_request_ids(true, txs.len() as usize, 16)?; }, Reply::Done => { break; } } } -``` \ No newline at end of file +```