Function
invokeByAddressCode
(address: string, args: unknown)
Source from the content-addressed store, hash-verified
| 127 | }); |
| 128 | |
| 129 | const invokeByAddressCode = (address: string, args: unknown) => ` |
| 130 | const segments = ${JSON.stringify(address)}.split(".").slice(1); |
| 131 | let node = tools; |
| 132 | for (const segment of segments) node = node[segment]; |
| 133 | const result = await node(${JSON.stringify(args)}); |
| 134 | return JSON.stringify(result); |
| 135 | `; |
| 136 | |
| 137 | type ToolEnvelope = { |
| 138 | readonly ok: boolean; |
Tested by
no test coverage detected