Skip to content

Commit f5034be

Browse files
committed
fix: attestation from double post
1 parent 9c31cd7 commit f5034be

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

packages/plugin-tee/src/actions/remoteAttestation.ts

+9-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { IAgentRuntime, Memory, State, HandlerCallback } from "@elizaos/core";
22
import { RemoteAttestationProvider } from "../providers/remoteAttestationProvider";
3+
import { File } from "formdata-node";
34

45
function hexToUint8Array(hex: string) {
56
hex = hex.trim();
@@ -33,9 +34,12 @@ async function uploadUint8Array(data: Uint8Array) {
3334
formData.append("file", file);
3435

3536
return await fetch("https://proof.t16z.com/api/upload", {
36-
method: "POST",
37-
body: formData,
38-
});
37+
method: "POST",
38+
headers: {
39+
"Content-type": "multipart/form-data",
40+
},
41+
body: formData,
42+
});
3943
}
4044

4145
export const remoteAttestationAction = {
@@ -87,18 +91,10 @@ export const remoteAttestationAction = {
8791
{
8892
user: "{{user2}}",
8993
content: {
90-
text: "I'm running in a TEE, generate a remote attestation",
94+
text: "One second, let me generate and upload my attestation report",
9195
action: "REMOTE_ATTESTATION",
9296
},
93-
},
94-
{
95-
user: "{{user2}}",
96-
content: {
97-
text: `Sure thing, here is my attestation report
98-
https://proof.t16z.com/reports/a0fd21c0602374388addb2f5272ab61008f5adf9c9b9a85978b799accb9c3442
99-
`,
100-
},
101-
},
97+
}
10298
],
10399
],
104100
};

0 commit comments

Comments
 (0)