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

Split definition methods out of Broadcast Manager into new Definition Sender #790

Closed
wants to merge 2 commits into from

Conversation

awrichar
Copy link
Contributor

@awrichar awrichar commented May 4, 2022

Not totally crazy about the names defsender.Sender and defhandler.DefinitionHandler, but they need to be separate packages and this is where I landed...

… Sender

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
@@ -53,57 +88,36 @@ func (bm *broadcastManager) BroadcastIdentityClaim(ctx context.Context, ns strin
return bm.broadcastDefinitionCommon(ctx, ns, def, signingIdentity, tag, waitConfirm)
}

func (bm *broadcastManager) broadcastDefinitionCommon(ctx context.Context, ns string, def fftypes.Definition, signingIdentity *fftypes.SignerRef, tag string, waitConfirm bool) (*fftypes.Message, error) {
func (bm *definitionSender) broadcastDefinitionCommon(ctx context.Context, ns string, def fftypes.Definition, signingIdentity *fftypes.SignerRef, tag string, waitConfirm bool) (*fftypes.Message, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just want to note that this is probably the only method with functional changes beyond simple renaming. Due to the new separation between broadcast manager and definition sender, less of the data processing is done directly. We simply build a MessageInOut with InlineData, similar to any other broadcast. It feels clean overall, but I just wanted to point it out among the noise.

@codecov-commenter
Copy link

Codecov Report

Merging #790 (de00ade) into main (323eedb) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #790   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          323       323           
  Lines        20195     20206   +11     
=========================================
+ Hits         20195     20206   +11     
Impacted Files Coverage Δ
internal/broadcast/manager.go 100.00% <ø> (ø)
internal/defhandler/contracts.go 100.00% <ø> (ø)
internal/defhandler/datatype.go 100.00% <ø> (ø)
internal/defhandler/handler.go 100.00% <ø> (ø)
internal/defhandler/identity_claim.go 100.00% <ø> (ø)
internal/defhandler/identity_update.go 100.00% <ø> (ø)
internal/defhandler/identity_verification.go 100.00% <ø> (ø)
internal/defhandler/namespace.go 100.00% <ø> (ø)
internal/defhandler/network_node.go 100.00% <ø> (ø)
internal/defhandler/network_org.go 100.00% <ø> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 323eedb...de00ade. Read the comment docs.

Copy link
Contributor

@peterbroadhurst peterbroadhurst left a comment

Choose a reason for hiding this comment

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

Just checking @awrichar - could DefinitionSender go into the broadcast package? (hence leaving the definitions package with its current name, but only containing the handlers)

@awrichar
Copy link
Contributor Author

awrichar commented May 5, 2022

Yea, it probably could. But now I'm thinking it's best to pause on this until FIR-12 moves along a little further. The thought is that soon definitions will not necessarily be a broadcast, so they don't totally belong in the broadcast package. Going to wait until that next piece of work queues up though before doing any more shuffling here.

@peterbroadhurst peterbroadhurst marked this pull request as draft May 5, 2022 21:37
@peterbroadhurst
Copy link
Contributor

Converted to draft based on last comment

@awrichar
Copy link
Contributor Author

Replaced by #878

@awrichar awrichar closed this Jun 23, 2022
@awrichar awrichar deleted the definitions branch June 28, 2022 20:40
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