-
Notifications
You must be signed in to change notification settings - Fork 4
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
ADD: block_stream #20
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Stukalov-A-M <[email protected]>
618a8f6
to
22d6e10
Compare
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.
Good start. Please don't perceive my comments as very critical. I understand that you are new to Rust and the code is totally fine.
Rust/examples/block_stream.rs
Outdated
fn initiate_block_listener( | ||
iroha_client: &Client, | ||
initial_block_number: u64, | ||
) -> Result<(), Box<dyn Error>> { |
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.
For example readability, I'd move it into main
directly.
let iroha_client: Client = Client::new(&config).unwrap(); | ||
|
||
/// Processing the initial block number to a non zero value | ||
let block_number = NonZeroU64::new(1).expect("The block number most be > 0"); |
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.
I think the message in expect(..)
, in this case, would better say something like "it will never fail, because 1 > 0".
No description provided.