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

[sovereign] Fix epoch start pointer receivers interfaces #337

Merged

Conversation

mariusmihaic
Copy link
Contributor

@mariusmihaic mariusmihaic commented Dec 9, 2024

GetEpochStartHandler from SovereignChainHeader used to return a pointer reference to a completely different type of struct from mainnchain structs (EpochStart), whereas we use another struct EpochStartSovereign. This would cause setters and getters from SovereignChainHeader to not work properly.

  • Adapted existing sovereign structs to extend mainchain interfaces and use correct pointers.

@mariusmihaic mariusmihaic self-assigned this Dec 11, 2024
@sasurobert sasurobert self-requested a review December 11, 2024 10:35
}

// SetLastFinalizedHeaders sets epoch start data for main chain chain only
func (m *EpochStartSovereign) SetLastFinalizedHeaders(epochStartShardDataHandlers []data.EpochStartShardDataHandler) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is not used anywhere in mx-chain-go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesn't matter, I had to follow the interface for EpochStart, which should have getters and setters for all fields.

@mariusmihaic mariusmihaic merged commit fcd76c0 into feat/sovereign Dec 12, 2024
2 checks passed
@mariusmihaic mariusmihaic deleted the MX-15667-fix-epoch-start-pointer-receivers branch December 12, 2024 13:01
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