chore(runtime): audit (backport #17035) (#17036)

This commit is contained in:
mergify[bot] 2023-07-18 04:19:05 +00:00 committed by GitHub
parent d23caef6f6
commit 2049c4b82a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 9 deletions

View File

@ -38,6 +38,7 @@ func (a *AppBuilder) Build(db dbm.DB, traceStore io.Writer, baseAppOptions ...fu
a.app.BaseApp = bApp
a.app.configurator = module.NewConfigurator(a.app.cdc, a.app.MsgServiceRouter(), a.app.GRPCQueryRouter())
if err := a.app.ModuleManager.RegisterServices(a.app.configurator); err != nil {
panic(err)
}

View File

@ -33,12 +33,12 @@ func NewEventManager(ctx context.Context) event.Manager {
}
// Emit emits an typed event that is defined in the protobuf file.
// In the future these events will be added to consensus
// In the future these events will be added to consensus.
func (e Events) Emit(ctx context.Context, event protoiface.MessageV1) error {
return e.EventManagerI.EmitTypedEvent(event)
}
// EmitKV emits a key value pair event
// EmitKV emits a key value pair event.
func (e Events) EmitKV(ctx context.Context, eventType string, attrs ...event.Attribute) error {
attributes := make([]sdk.Attribute, 0, len(attrs))
@ -46,15 +46,12 @@ func (e Events) EmitKV(ctx context.Context, eventType string, attrs ...event.Att
attributes = append(attributes, sdk.NewAttribute(attr.Key, attr.Value))
}
events := sdk.Events{
sdk.NewEvent(eventType, attributes...),
}
e.EventManagerI.EmitEvents(events)
e.EventManagerI.EmitEvents(sdk.Events{sdk.NewEvent(eventType, attributes...)})
return nil
}
// Emit emits an typed event that is defined in the protobuf file.
// In the future these events will be added to consensus
// In the future these events will be added to consensus.
func (e Events) EmitNonConsensus(ctx context.Context, event protoiface.MessageV1) error {
return e.EventManagerI.EmitTypedEvent(event)
}

View File

@ -94,7 +94,7 @@ func ProvideApp(interfaceRegistry codectypes.InterfaceRegistry) (
// At startup, check that all proto annotations are correct.
if err := msgservice.ValidateProtoAnnotations(protoFiles); err != nil {
// Once we switch to using protoreflect-based antehandlers, we might
// Once we switch to using protoreflect-based ante handlers, we might
// want to panic here instead of logging a warning.
_, _ = fmt.Fprintln(os.Stderr, err.Error())
}
@ -178,10 +178,12 @@ func ProvideInterfaceRegistry(customGetSigners []signing.CustomGetSigner) (codec
if err != nil {
return nil, err
}
err = interfaceRegistry.SigningContext().Validate()
if err != nil {
return nil, err
}
return interfaceRegistry, nil
}

View File

@ -32,6 +32,7 @@ func NewAutoCLIQueryService(appModules map[string]interface{}) *AutoCLIQueryServ
}
// ExtractAutoCLIOptions extracts autocli ModuleOptions from the provided app modules.
//
// Example Usage:
//
// ExtractAutoCLIOptions(ModuleManager.Modules)

View File

@ -18,7 +18,7 @@ type AppI interface {
Name() string
// The application types codec.
// NOTE: This shoult be sealed before being returned.
// NOTE: This should NOT be sealed before being returned.
LegacyAmino() *codec.LegacyAmino
// Application updates every begin block.