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] Index reward txs in outport block #6638

Merged
merged 16 commits into from
Dec 9, 2024

Conversation

mariusmihaic
Copy link
Contributor

@mariusmihaic mariusmihaic commented Nov 26, 2024

Reasoning behind the pull request

  • Index reward txs in outport block for sovereign processing

Proposed changes

  • Add APIRewardsTxHandler interface to return different results(normal vs sovereign run type) for reward txs when calling api route transaction/:hash
  • Changed the way rewards are exported in outport block by creating OutportDataProviderFactory (normal vs sovereign run type)
  • Add rewards to be indexed from sovereignChainBlock processing

Testing procedure

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@mariusmihaic mariusmihaic self-assigned this Nov 26, 2024
Base automatically changed from MX-15587-finish-update-state-sovereign to feat/chain-go-sdk November 29, 2024 13:56
@mariusmihaic mariusmihaic marked this pull request as ready for review December 5, 2024 13:55
@axenteoctavian axenteoctavian self-requested a review December 6, 2024 09:37
@@ -2116,6 +2116,9 @@ func checkProcessComponentsArgs(args ProcessComponentsFactoryArgs) error {
if check.IfNil(args.RunTypeComponents.ExportHandlerFactoryCreator()) {
return fmt.Errorf("%s: %w", baseErrMessage, errorsMx.ErrNilExportHandlerFactoryCreator)
}
if check.IfNil(args.RunTypeComponents.OutportDataProviderFactory()) {
return fmt.Errorf("%s: %w", baseErrMessage, errorsMx.ErrNilOutportDataProviderFactory)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Missing nil check for APIRewardsTxHandler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it's not being used anywhere here.
It is used and checked in CreateApiResolver

pcf, err := processComp.NewProcessComponentsFactory(args)
require.True(t, errors.Is(err, errorsMx.ErrNilOutportDataProviderFactory))
require.Nil(t, pcf)
})
Copy link
Contributor

Choose a reason for hiding this comment

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

missing nil test for APIRewardsTxHandler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need, see the comment above

@mariusmihaic mariusmihaic merged commit 7a6b7b5 into feat/chain-go-sdk Dec 9, 2024
5 checks passed
@mariusmihaic mariusmihaic deleted the MX-15708-sovereign-index-reward-txs branch December 9, 2024 09:14
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