Change func name and nil pointer check based on comments

This commit is contained in:
Shrenuj Bansal 2022-08-17 10:47:05 -04:00
parent 32a2ae12cb
commit 60751f809b
2 changed files with 5 additions and 2 deletions

View File

@ -78,7 +78,7 @@ func ConfigStorageMiner(c interface{}) Option {
return Options(
Override(new(v1api.FullNode), modules.GetUuidWrapper),
Override(new(v1api.FullNode), modules.MakeUuidWrapper),
// Needed to instantiate pubsub used by index provider via ConfigCommon
Override(new(dtypes.DrandSchedule), modules.BuiltinDrandConfig),
Override(new(dtypes.BootstrapPeers), modules.BuiltinBootstrap),

View File

@ -85,11 +85,14 @@ type UuidWrapper struct {
}
func (a *UuidWrapper) MpoolPushMessage(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec) (*types.SignedMessage, error) {
if spec == nil {
spec = new(api.MessageSendSpec)
}
spec.MsgUuid = uuid.New()
return a.FullNode.MpoolPushMessage(ctx, msg, spec)
}
func GetUuidWrapper(a v1api.RawFullNodeAPI) v1api.FullNode {
func MakeUuidWrapper(a v1api.RawFullNodeAPI) v1api.FullNode {
return &UuidWrapper{a}
}