From 64eb3cf543aa0b96701adea6f4a5285786cae65b Mon Sep 17 00:00:00 2001 From: DavidOrchard Date: Wed, 9 Oct 2024 14:35:57 -0700 Subject: [PATCH] update trigger script (#14707) --- core/capabilities/webapi/trigger.go | 2 +- core/scripts/gateway/web_api_trigger/invoke_trigger.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/capabilities/webapi/trigger.go b/core/capabilities/webapi/trigger.go index 5dbb38500e4..870b1883d2d 100644 --- a/core/capabilities/webapi/trigger.go +++ b/core/capabilities/webapi/trigger.go @@ -241,7 +241,7 @@ func (h *triggerConnectorHandler) UnregisterTrigger(ctx context.Context, req cap func (h *triggerConnectorHandler) Start(ctx context.Context) error { return h.StartOnce("GatewayConnectorServiceWrapper", func() error { - return h.connector.AddHandler([]string{"web_trigger"}, h) + return h.connector.AddHandler([]string{"web_api_trigger"}, h) }) } func (h *triggerConnectorHandler) Close() error { diff --git a/core/scripts/gateway/web_api_trigger/invoke_trigger.go b/core/scripts/gateway/web_api_trigger/invoke_trigger.go index 00bc08b3489..610abc65e86 100644 --- a/core/scripts/gateway/web_api_trigger/invoke_trigger.go +++ b/core/scripts/gateway/web_api_trigger/invoke_trigger.go @@ -9,6 +9,8 @@ import ( "io" "net/http" "os" + "strconv" + "time" "github.com/ethereum/go-ethereum/crypto" "github.com/joho/godotenv" @@ -53,7 +55,7 @@ func main() { gatewayURL := flag.String("gateway_url", "http://localhost:5002", "Gateway URL") privateKey := flag.String("private_key", "65456ffb8af4a2b93959256a8e04f6f2fe0943579fb3c9c3350593aabb89023f", "Private key to sign the message with") messageID := flag.String("id", "12345", "Request ID") - methodName := flag.String("method", "web_trigger", "Method name") + methodName := flag.String("method", "web_api_trigger", "Method name") donID := flag.String("don_id", "workflow_don_1", "DON ID") flag.Parse() @@ -78,7 +80,7 @@ func main() { payload := `{ "trigger_id": "web-trigger@1.0.0", "trigger_event_id": "action_1234567890", - "timestamp": 1234567890, + "timestamp": ` + strconv.Itoa(int(time.Now().Unix())) + `, "topics": ["daily_price_update"], "params": { "bid": "101",