-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
solarkraft/package.json
Outdated
@@ -30,14 +30,15 @@ | |||
"dist/**/*" | |||
], | |||
"scripts": { | |||
"alert": "mocha --timeout 0 --loader=ts-node/esm test/alert/**/*.test.ts", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this 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
Closes #67
Adds a method
invokeAlert
, which submits the monitor analysis status to the alert contract.Calling
invokeAlert
requires a knownsorobanRpcServer
, 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.