-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Log] Changes to epoch hash. #2420
Conversation
Co-authored-by: Howard Wu <9260812+howardwu@users.noreply.github.com> Signed-off-by: d0cd <23022326+d0cd@users.noreply.github.com>
Co-authored-by: Howard Wu <9260812+howardwu@users.noreply.github.com> Signed-off-by: d0cd <23022326+d0cd@users.noreply.github.com>
^CI is failing |
ledger/src/advance.rs
Outdated
// Get the height of the block. | ||
let height = block.height(); | ||
// Get the epoch hash for the block. | ||
let epoch_hash = &self.get_epoch_hash(height).ok(); |
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.
Can you one-line this?
ledger/src/advance.rs
Outdated
// Update the current epoch hash. | ||
self.current_epoch_hash.write().clone_from(&self.get_epoch_hash(block.height()).ok()); | ||
self.current_epoch_hash.write().clone_from(epoch_hash); |
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.
You can move this into L114
ledger/src/advance.rs
Outdated
// Get the epoch hash for the block. | ||
let epoch_hash = &self.get_epoch_hash(height).ok(); | ||
// Log the update of the current epoch hash. | ||
match epoch_hash { |
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.
You can move the one-line to this match statement
This PR logs changes to the
current_epoch_hash
in theLedger
.