Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds programmatic alert contract invocation #75

Merged
merged 4 commits into from
May 23, 2024
Merged

Adds programmatic alert contract invocation #75

merged 4 commits into from
May 23, 2024

Conversation

Kukovec
Copy link
Collaborator

@Kukovec Kukovec commented May 22, 2024

Closes #67

Adds a method invokeAlert, which submits the monitor analysis status to the alert contract.
Calling invokeAlert requires a known sorobanRpcServer, as well as an account/keypair with which to sign/submit transactions. In the test, the latter are randomly generated and funded, but we should probably hardcode them to cut down on response waiting times.

@@ -30,14 +30,15 @@
"dist/**/*"
],
"scripts": {
"alert": "mocha --timeout 0 --loader=ts-node/esm test/alert/**/*.test.ts",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not put it under e2e which already exists?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, partially because it's not really end-to-end, more like mid-to-end, but more prominently, because this way it gets a separate timeout flag, since it's currently doing some back-and-forth requests each time, and so the test takes longer than all the rest (which have a default of 2s timeout)

Copy link
Collaborator

@thpani thpani May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can set the timeout. See the current e2e tests

Copy link
Contributor

@konnov konnov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Please fix the comments by @thpani and myself

solarkraft/package.json Outdated Show resolved Hide resolved
solarkraft/src/invokeAlert.ts Outdated Show resolved Hide resolved
@Kukovec Kukovec merged commit bc675c9 into main May 23, 2024
3 checks passed
@Kukovec Kukovec deleted the jk/alertinvoke branch May 23, 2024 10:08
@konnov konnov added this to the M3: Alert contract milestone Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Alert contract
3 participants