Skip to content
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

polish: add Equals method to MinerInfo shim #4604

Merged
merged 1 commit into from
Oct 27, 2020

Conversation

frrist
Copy link
Member

@frrist frrist commented Oct 26, 2020

Motivation

Easier comparison of MinerInfo structs

Implementation

Perform a comparison by casting the interface to its underlying structure and comparing Info cids similar to what is done in DeadlinesChanged.

@frrist frrist requested a review from Stebalien October 26, 2020 21:24
@frrist frrist self-assigned this Oct 26, 2020
@whyrusleeping
Copy link
Member

this might cause problems if these structs ever get roundtripped over json. The cid field would get cleared, and any two miner infos would be 'equal'

@frrist
Copy link
Member Author

frrist commented Oct 26, 2020

Ahh you are right, good catch. What are your feelings on exporting the CID field? For context Visor would like this for easier state inspection when miner states change.

Edit: On second thought it will probably be easiest to mimic the DeadlinesChanged behaviour.

@frrist frrist force-pushed the frrist/miner-shim-info-equal branch from 3d0e401 to 0d38405 Compare October 26, 2020 21:49
@frrist
Copy link
Member Author

frrist commented Oct 27, 2020

The code added here currently isn't called anywhere in lotus. The CI failures appear to be flaky tests.

@whyrusleeping whyrusleeping merged commit 2b6bc7d into master Oct 27, 2020
@whyrusleeping whyrusleeping deleted the frrist/miner-shim-info-equal branch October 27, 2020 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants