From 63364676b31fd36f94823816c7f17f41cabe78b2 Mon Sep 17 00:00:00 2001 From: zees-dev Date: Sat, 15 Jun 2024 13:54:59 +1200 Subject: [PATCH] response execution support for signature --- models/execute/response.go | 1 + node/worker_execute.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/models/execute/response.go b/models/execute/response.go index 6feddf38..080a7bad 100644 --- a/models/execute/response.go +++ b/models/execute/response.go @@ -15,6 +15,7 @@ type Result struct { Result RuntimeOutput `json:"result"` RequestID string `json:"request_id"` Usage Usage `json:"usage,omitempty"` + Signature []byte `json:"signature,omitempty"` } // Cluster represents the set of peers that executed the request. diff --git a/node/worker_execute.go b/node/worker_execute.go index 343b4d90..773ab403 100644 --- a/node/worker_execute.go +++ b/node/worker_execute.go @@ -2,6 +2,7 @@ package node import ( "context" + "encoding/hex" "fmt" "time" @@ -47,6 +48,7 @@ func (n *Node) workerProcessExecute(ctx context.Context, from peer.ID, req reque Results: execute.ResultMap{ n.host.ID(): result, }, + Signature: hex.EncodeToString(result.Signature), } // Send the response, whatever it may be (success or failure).