这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Conversation

@rlkelly
Copy link
Contributor

@rlkelly rlkelly commented Apr 24, 2018

No description provided.

Copy link
Contributor

@garious garious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely what I had in mind - thanks for taking this on! This is an important step in moving to an async client. Just a few nits (comments inline). Also, can you run rustfmt on this code? The CI job will fail otherwise.

true
}

// fn forget_signature_with_last_id(&self, last_id: &Hash) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need this. Even if not commented out, it's not right. It should remove last_id, not the last item.

/// until the server sends a response. If the response packet is dropped
/// by the network, this method will hang indefinitely.
pub fn get_balance(&self, pubkey: &PublicKey) -> io::Result<Option<i64>> {
pub fn get_balance(&self, pubkey: &PublicKey) -> FutureResult<i64, i64> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about something likeFutureResult<Option<i64>, io::Error> ? Or perhaps the library offers a futures::io::FutureResult<Option<i64>>?

let req = Request::GetBalance { key: *pubkey };
let data = serialize(&req).expect("serialize GetBalance");
self.socket.send_to(&data, &self.addr)?;
self.socket.send_to(&data, &self.addr).expect("buffer error");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't panic on this one. It's too likely to happen.

/// it also has the side-effect of causing the server to log any
/// entries that have been published by the Historian.
pub fn get_last_id(&self) -> io::Result<Hash> {
pub fn get_last_id(&self) -> FutureResult<Hash, ()> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, io::Errror instead of ()?

@rlkelly
Copy link
Contributor Author

rlkelly commented Apr 25, 2018

sure thing, i'll knock this out in a few hours

@garious
Copy link
Contributor

garious commented Apr 26, 2018

See #150

@garious garious closed this Apr 26, 2018
vkomenda pushed a commit to vkomenda/solana that referenced this pull request Aug 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants