You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases it comes handy to have the upon and emit functions directly handle the entire proto message and not receive each of its fields in a separate parameter, for example:
checkpointpbdsl.UponStableCheckpoint(m, func(sn types.SeqNr, snapshot *commonpbtypes.StateSnapshot, cert map[t.NodeID][]uint8) error {
// need to reconstruc stableCheckpoint for the function
chkp := &checkpoint.StableCheckpoint{
Sn: sn,
Snapshot: snapshot,
Cert: cert,
}
if err := appModule.appLogic.Checkpoint(stableCheckpoint); err != nil {
return nil, fmt.Errorf("error handling StableCheckpoint event: %w", err)
}
return nil
})
This function would be greatly simplified if the parameter was the proto message itself (removing boilerplate code).
The text was updated successfully, but these errors were encountered:
In some cases it comes handy to have the upon and emit functions directly handle the entire proto message and not receive each of its fields in a separate parameter, for example:
This function would be greatly simplified if the parameter was the proto message itself (removing boilerplate code).
The text was updated successfully, but these errors were encountered: