这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions model/actions/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func (a Trigger) Validate(ctx ValidatorContext) (response ValidateResponse) {
return response.Error(ctx, MsgTriggerTypeNotSupported, a.Type, TriggerTypes)
}

// This handles just type
if a.Periodic == nil && a.Webhook == nil && a.Block == nil && a.Transaction == nil && a.Alert == nil {
return response
}

switch a.Type {
case PeriodicType:
if a.Periodic == nil {
Expand All @@ -58,7 +53,7 @@ func (a Trigger) Validate(ctx ValidatorContext) (response ValidateResponse) {
return response.Merge(a.Transaction.Validate(ctx.With(a.Type)))
case AlertType:
if a.Alert == nil {
return response.Error(ctx, MsgTriggerTypeMismatch, a.Type)
return response
}
return response.Merge(a.Alert.Validate(ctx.With(a.Type)))
}
Expand Down