Skip to content

Commit

Permalink
passing payloads to witnesses in sentinel
Browse files Browse the repository at this point in the history
  • Loading branch information
arietrouw committed Oct 3, 2023
1 parent d51ccd0 commit f63d132
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 60 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"docker",
"nftData",
"**/testData.json",
"*.stories.*",
"swagger.json",
".yarn"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@babel/preset-env": "^7.22.20",
"@babel/preset-typescript": "^7.23.0",
"@types/jest": "^29.5.5",
"@types/supertest": "^2.0.13",
"@types/supertest": "^2.0.14",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"@xylabs/eslint-config": "^3.0.82",
Expand Down
2 changes: 1 addition & 1 deletion packages/automation-witness-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"author": "Arie Trouw",
"license": "LGPL-3.0",
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.421.0",
"@aws-sdk/client-secrets-manager": "^3.423.0",
"@ethersproject/address": "^5.7.0",
"@ethersproject/contracts": "^5.7.0",
"@ethersproject/networks": "^5.7.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"xyo": "dist/index.js"
},
"devDependencies": {
"@types/node": "^20.8.0",
"@types/node": "^20.8.2",
"@types/tail": "^2.2.1",
"@types/terminal-kit": "^2.5.2",
"@xylabs/ts-scripts-yarn3": "^3.0.82",
Expand Down
6 changes: 3 additions & 3 deletions packages/modules/packages/sentinel/src/MemorySentinel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class MemorySentinel<
const resultPayloads: Payload[] = []

try {
const [generatedPayloads, generatedErrors] = await this.generateResults(allWitnesses)
const [generatedPayloads, generatedErrors] = await this.generateResults(allWitnesses, payloads)
const combinedPayloads = [...generatedPayloads, ...payloads]
resultPayloads.push(...combinedPayloads)
errors.push(...generatedErrors)
Expand All @@ -44,8 +44,8 @@ export class MemorySentinel<
return [boundWitness, ...resultPayloads]
}

private async generateResults(witnesses: WitnessInstance[]): Promise<[Payload[], Error[]]> {
const results = await Promise.allSettled(witnesses?.map((witness) => witness.observe()))
private async generateResults(witnesses: WitnessInstance[], inPayloads?: Payload[]): Promise<[Payload[], Error[]]> {
const results = await Promise.allSettled(witnesses?.map((witness) => witness.observe(inPayloads)))
const payloads = results
.filter(fulfilled)
.map((result) => result.value)
Expand Down
2 changes: 1 addition & 1 deletion packages/node/packages/core/packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"main": "dist/node/index.js",
"module": "dist/node/index.mjs",
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.421.0",
"@aws-sdk/client-secrets-manager": "^3.423.0",
"@xylabs/assert": "^2.12.14",
"@xylabs/sdk-api-express-ecs": "^1.4.0",
"@xyo-network/account": "workspace:~",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"author": "Arie Trouw",
"license": "LGPL-3.0",
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.421.0",
"@aws-sdk/client-secrets-manager": "^3.423.0",
"@xylabs/assert": "^2.12.14",
"@xylabs/exists": "^2.12.14",
"@xylabs/sdk-api-express-ecs": "^1.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/node/packages/express/packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"author": "Arie Trouw",
"license": "LGPL-3.0",
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.421.0",
"@aws-sdk/client-secrets-manager": "^3.423.0",
"@xylabs/assert": "^2.12.14",
"@xylabs/sdk-api-express-ecs": "^1.4.0",
"@xyo-network/module-model": "workspace:~",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"author": "Arie Trouw",
"license": "LGPL-3.0",
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.421.0",
"@aws-sdk/client-secrets-manager": "^3.423.0",
"@xylabs/assert": "^2.12.14",
"@xylabs/sdk-api-express-ecs": "^1.4.0",
"@xyo-network/node-model": "workspace:~",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"author": "Arie Trouw",
"license": "LGPL-3.0",
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.421.0",
"@aws-sdk/client-secrets-manager": "^3.423.0",
"@xylabs/assert": "^2.12.14",
"@xylabs/exists": "^2.12.14",
"@xylabs/sdk-api-express-ecs": "^1.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"author": "Arie Trouw",
"license": "LGPL-3.0",
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.421.0",
"@aws-sdk/client-secrets-manager": "^3.423.0",
"@xylabs/assert": "^2.12.14",
"@xylabs/sdk-api-express-ecs": "^1.4.0",
"@xyo-network/express-node-dependencies": "workspace:~",
Expand Down
96 changes: 48 additions & 48 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ __metadata:
languageName: node
linkType: hard

"@aws-sdk/client-secrets-manager@npm:^3.421.0":
version: 3.421.0
resolution: "@aws-sdk/client-secrets-manager@npm:3.421.0"
"@aws-sdk/client-secrets-manager@npm:^3.423.0":
version: 3.423.0
resolution: "@aws-sdk/client-secrets-manager@npm:3.423.0"
dependencies:
"@aws-crypto/sha256-browser": 3.0.0
"@aws-crypto/sha256-js": 3.0.0
"@aws-sdk/client-sts": 3.421.0
"@aws-sdk/credential-provider-node": 3.421.0
"@aws-sdk/client-sts": 3.423.0
"@aws-sdk/credential-provider-node": 3.423.0
"@aws-sdk/middleware-host-header": 3.418.0
"@aws-sdk/middleware-logger": 3.418.0
"@aws-sdk/middleware-recursion-detection": 3.418.0
Expand Down Expand Up @@ -176,7 +176,7 @@ __metadata:
"@smithy/util-utf8": ^2.0.0
tslib: ^2.5.0
uuid: ^8.3.2
checksum: 85da7d58292b6e35d4d6671c3fc83b293d427e45736aaea515c730119e85684e48334e513634c682ab0f89cecf52b5739b214f1308e2a3ade0f2b0db872a2f98
checksum: 79650a37be40aa533987f16d6c6d3bb656c5c9cecf54181dbcf57ccde536e7be02fcd5cd583d0ed8cccc9a084049a7ea68db9a73b6b410bfa33120c15ec1d2f2
languageName: node
linkType: hard

Expand Down Expand Up @@ -222,9 +222,9 @@ __metadata:
languageName: node
linkType: hard

"@aws-sdk/client-sso@npm:3.421.0":
version: 3.421.0
resolution: "@aws-sdk/client-sso@npm:3.421.0"
"@aws-sdk/client-sso@npm:3.423.0":
version: 3.423.0
resolution: "@aws-sdk/client-sso@npm:3.423.0"
dependencies:
"@aws-crypto/sha256-browser": 3.0.0
"@aws-crypto/sha256-js": 3.0.0
Expand Down Expand Up @@ -260,7 +260,7 @@ __metadata:
"@smithy/util-retry": ^2.0.2
"@smithy/util-utf8": ^2.0.0
tslib: ^2.5.0
checksum: 2dcfbd104668f49fc5b18af6a5bced3845e75c1facab7fd26e97c40ea447e9c29d4f3a5e14d90e66a008db251a6aa27fc8af7652e3c1d8916853ff37df28c72c
checksum: 49b1ec33a27714c3534ccfb081dc601725912ba813d81e7ea280a562f2482a49cc47e27b99b79f186ee3b52555182bbbfe02cdc683730490160507307c946d78
languageName: node
linkType: hard

Expand Down Expand Up @@ -310,13 +310,13 @@ __metadata:
languageName: node
linkType: hard

"@aws-sdk/client-sts@npm:3.421.0":
version: 3.421.0
resolution: "@aws-sdk/client-sts@npm:3.421.0"
"@aws-sdk/client-sts@npm:3.423.0":
version: 3.423.0
resolution: "@aws-sdk/client-sts@npm:3.423.0"
dependencies:
"@aws-crypto/sha256-browser": 3.0.0
"@aws-crypto/sha256-js": 3.0.0
"@aws-sdk/credential-provider-node": 3.421.0
"@aws-sdk/credential-provider-node": 3.423.0
"@aws-sdk/middleware-host-header": 3.418.0
"@aws-sdk/middleware-logger": 3.418.0
"@aws-sdk/middleware-recursion-detection": 3.418.0
Expand Down Expand Up @@ -352,7 +352,7 @@ __metadata:
"@smithy/util-utf8": ^2.0.0
fast-xml-parser: 4.2.5
tslib: ^2.5.0
checksum: c21a28288341a7f6749e61391846b7a6754de3594137a7c436b1d96d82a8043adc921b45f8d22e2894e50cdf3799f51143a42f214ae552bcd0e0088c85d2de09
checksum: 5f41be3203e6f2b9d45a61159a63f1f7b8e4fbea788cc4628b9683ce240294f48e09c093f6aef535b4869e647d7350f6e801b638433361a2ce0e8871c69e0b0f
languageName: node
linkType: hard

Expand Down Expand Up @@ -399,21 +399,21 @@ __metadata:
languageName: node
linkType: hard

"@aws-sdk/credential-provider-ini@npm:3.421.0":
version: 3.421.0
resolution: "@aws-sdk/credential-provider-ini@npm:3.421.0"
"@aws-sdk/credential-provider-ini@npm:3.423.0":
version: 3.423.0
resolution: "@aws-sdk/credential-provider-ini@npm:3.423.0"
dependencies:
"@aws-sdk/credential-provider-env": 3.418.0
"@aws-sdk/credential-provider-process": 3.418.0
"@aws-sdk/credential-provider-sso": 3.421.0
"@aws-sdk/credential-provider-sso": 3.423.0
"@aws-sdk/credential-provider-web-identity": 3.418.0
"@aws-sdk/types": 3.418.0
"@smithy/credential-provider-imds": ^2.0.0
"@smithy/property-provider": ^2.0.0
"@smithy/shared-ini-file-loader": ^2.0.6
"@smithy/types": ^2.3.3
tslib: ^2.5.0
checksum: 038e115250a966a28b43faa6a70ef4e9d543d51e0eed8446d0939c44a7a0c3333a3dcb0a80aa5c2b328cc225228aef8f8aa5b31ba1725316b3019b88ad091ad8
checksum: 8bb4fecb6434452de0ac15041693a45b783f2368f7561359a6b4f1a6051162b35798095449c0abbcfebc8d0ef036377f1539b785a6fdf51b7866ad2329588d61
languageName: node
linkType: hard

Expand All @@ -436,22 +436,22 @@ __metadata:
languageName: node
linkType: hard

"@aws-sdk/credential-provider-node@npm:3.421.0":
version: 3.421.0
resolution: "@aws-sdk/credential-provider-node@npm:3.421.0"
"@aws-sdk/credential-provider-node@npm:3.423.0":
version: 3.423.0
resolution: "@aws-sdk/credential-provider-node@npm:3.423.0"
dependencies:
"@aws-sdk/credential-provider-env": 3.418.0
"@aws-sdk/credential-provider-ini": 3.421.0
"@aws-sdk/credential-provider-ini": 3.423.0
"@aws-sdk/credential-provider-process": 3.418.0
"@aws-sdk/credential-provider-sso": 3.421.0
"@aws-sdk/credential-provider-sso": 3.423.0
"@aws-sdk/credential-provider-web-identity": 3.418.0
"@aws-sdk/types": 3.418.0
"@smithy/credential-provider-imds": ^2.0.0
"@smithy/property-provider": ^2.0.0
"@smithy/shared-ini-file-loader": ^2.0.6
"@smithy/types": ^2.3.3
tslib: ^2.5.0
checksum: 0b0249ebc58383e7149f8b5398ca8d6af93df397fae4c0feaea9debd4617a90d7c9a01486709173799edaf06c6c34e9c979969da1a41bdb681d01c6661e6e0e3
checksum: 25744a9845183a4b79b6bb67c24f76fe6dbddf35d3946f9d115d82e56e51eb0f2c3b93fc7b4fe71dcde959366385bacca2912c4722c1a14aa1e246e4c4711a6d
languageName: node
linkType: hard

Expand Down Expand Up @@ -483,18 +483,18 @@ __metadata:
languageName: node
linkType: hard

"@aws-sdk/credential-provider-sso@npm:3.421.0":
version: 3.421.0
resolution: "@aws-sdk/credential-provider-sso@npm:3.421.0"
"@aws-sdk/credential-provider-sso@npm:3.423.0":
version: 3.423.0
resolution: "@aws-sdk/credential-provider-sso@npm:3.423.0"
dependencies:
"@aws-sdk/client-sso": 3.421.0
"@aws-sdk/client-sso": 3.423.0
"@aws-sdk/token-providers": 3.418.0
"@aws-sdk/types": 3.418.0
"@smithy/property-provider": ^2.0.0
"@smithy/shared-ini-file-loader": ^2.0.6
"@smithy/types": ^2.3.3
tslib: ^2.5.0
checksum: 7fd59a74fe28602ac0877c9e845a95a95a3be91869be33776576c2cbe41cce8b5921480e769a1fdf02db41f67d792e9f1ea93d9e5f0256736cea8f24d8839b24
checksum: 5686465912cbf988b449edf42f56d323573db72f1792000632e84d33af9a5f0627a9322367e57d7e25a135a7bf96fa5d7dd00c81608a42d07842c913e9328301
languageName: node
linkType: hard

Expand Down Expand Up @@ -5225,10 +5225,10 @@ __metadata:
languageName: node
linkType: hard

"@types/node@npm:*, @types/node@npm:^20.7.2, @types/node@npm:^20.8.0":
version: 20.8.0
resolution: "@types/node@npm:20.8.0"
checksum: ebad6342d54238a24bf980d7750117a5d67749c9b72cbb7a974a1e932c39034aa3a810d669e007e8a5071782a253aa069a187b614407a382403c9826e837c849
"@types/node@npm:*, @types/node@npm:^20.7.2, @types/node@npm:^20.8.2":
version: 20.8.2
resolution: "@types/node@npm:20.8.2"
checksum: 3da73e25d821bfcdb7de98589027e08bb4848e55408671c4a83ec0341e124b5313a0b20e1e4b4eff1168ea17a86f622ad73fcb04b761abd77496b9a27cbd5de5
languageName: node
linkType: hard

Expand Down Expand Up @@ -5328,12 +5328,12 @@ __metadata:
languageName: node
linkType: hard

"@types/supertest@npm:^2.0.13":
version: 2.0.13
resolution: "@types/supertest@npm:2.0.13"
"@types/supertest@npm:^2.0.14":
version: 2.0.14
resolution: "@types/supertest@npm:2.0.14"
dependencies:
"@types/superagent": "*"
checksum: fe66be8e16626f254dc9d9691706942689f47a84edf7d3baaeadd6d4d576dbf915ee70cebdd7034015e83fa91fcd2dcff1cd0252514e4c510619817a183b5b4f
checksum: 9f6850a22b8f0fd4c26a6dfd9b64771a66476b1a4f841a3b84a9da843ce69463efbf37594fe107297dd14a225d199b802464d48d70e9413238c637903d392137
languageName: node
linkType: hard

Expand Down Expand Up @@ -6441,7 +6441,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@xyo-network/automation-witness-server@workspace:packages/automation-witness-server"
dependencies:
"@aws-sdk/client-secrets-manager": ^3.421.0
"@aws-sdk/client-secrets-manager": ^3.423.0
"@ethersproject/address": ^5.7.0
"@ethersproject/contracts": ^5.7.0
"@ethersproject/networks": ^5.7.1
Expand Down Expand Up @@ -6779,7 +6779,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@xyo-network/cli@workspace:packages/cli"
dependencies:
"@types/node": ^20.8.0
"@types/node": ^20.8.2
"@types/tail": ^2.2.1
"@types/terminal-kit": ^2.5.2
"@xylabs/assert": ^2.12.14
Expand Down Expand Up @@ -8315,7 +8315,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@xyo-network/express-node-dependencies@workspace:packages/node/packages/express/packages/dependencies"
dependencies:
"@aws-sdk/client-secrets-manager": ^3.421.0
"@aws-sdk/client-secrets-manager": ^3.423.0
"@xylabs/assert": ^2.12.14
"@xylabs/exists": ^2.12.14
"@xylabs/sdk-api-express-ecs": ^1.4.0
Expand Down Expand Up @@ -8371,7 +8371,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@xyo-network/express-node-lib@workspace:packages/node/packages/express/packages/lib"
dependencies:
"@aws-sdk/client-secrets-manager": ^3.421.0
"@aws-sdk/client-secrets-manager": ^3.423.0
"@types/express": 4.17.18
"@xylabs/assert": ^2.12.14
"@xylabs/sdk-api-express-ecs": ^1.4.0
Expand All @@ -8396,7 +8396,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@xyo-network/express-node-middleware@workspace:packages/node/packages/express/packages/middleware"
dependencies:
"@aws-sdk/client-secrets-manager": ^3.421.0
"@aws-sdk/client-secrets-manager": ^3.423.0
"@types/express": 4.17.18
"@types/express-mung": ^0.5.3
"@types/swagger-ui-express": ^4.1.4
Expand Down Expand Up @@ -8424,7 +8424,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@xyo-network/express-node-routes@workspace:packages/node/packages/express/packages/routes"
dependencies:
"@aws-sdk/client-secrets-manager": ^3.421.0
"@aws-sdk/client-secrets-manager": ^3.423.0
"@types/express": 4.17.18
"@xylabs/assert": ^2.12.14
"@xylabs/exists": ^2.12.14
Expand Down Expand Up @@ -8470,7 +8470,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@xyo-network/express-node-server@workspace:packages/node/packages/express/packages/server"
dependencies:
"@aws-sdk/client-secrets-manager": ^3.421.0
"@aws-sdk/client-secrets-manager": ^3.423.0
"@types/compression": ^1.7.3
"@types/cors": ^2.8.14
"@types/express": 4.17.18
Expand Down Expand Up @@ -9258,7 +9258,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@xyo-network/node-app@workspace:packages/node/packages/core/packages/app"
dependencies:
"@aws-sdk/client-secrets-manager": ^3.421.0
"@aws-sdk/client-secrets-manager": ^3.423.0
"@xylabs/assert": ^2.12.14
"@xylabs/sdk-api-express-ecs": ^1.4.0
"@xylabs/ts-scripts-yarn3": ^3.0.82
Expand Down Expand Up @@ -9859,7 +9859,7 @@ __metadata:
"@babel/preset-env": ^7.22.20
"@babel/preset-typescript": ^7.23.0
"@types/jest": ^29.5.5
"@types/supertest": ^2.0.13
"@types/supertest": ^2.0.14
"@typescript-eslint/eslint-plugin": ^6.7.4
"@typescript-eslint/parser": ^6.7.4
"@xylabs/eslint-config": ^3.0.82
Expand Down

0 comments on commit f63d132

Please sign in to comment.