-
Notifications
You must be signed in to change notification settings - Fork 13
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
correct signatuee due to wrong indentation and fix failed test #73
Conversation
@chrisli30 Plase check this PR it will fix the auth key issue. Other issue i'm still working on it. |
@@ -250,6 +250,8 @@ describe("createWorkflow Tests", () => { | |||
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" | |||
&& trigger1.data.topics[2] == "${wallet.address}" | |||
`, | |||
// We don't need but the compare result look at its as a whole | |||
matcher: [], |
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.
because the comparion now looks at the whole object instead of comparision specific field we need to pass this in. it only needed for the comparison below.
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.
okay, we need an empty array of matcher here.
@@ -306,7 +308,7 @@ describe("createWorkflow Tests", () => { | |||
type: TriggerType.Event, | |||
data: { | |||
matcher: [ | |||
{ type: "topics", value: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", null, "0x06DBb141d8275d9eDb8a7446F037D20E215188ff"] }, | |||
{ type: "topics", value: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "", "0x06DBb141d8275d9eDb8a7446F037D20E215188ff"] }, |
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 is one of the weak point of gRPC. We cannot pass null in an array. There is a way around it by define a custom type.
The general way to re-present absence of value is use the empty value of that. So ""
instead of null.
There still way if we absolute have to pass nul by define a custom type, instead of using string. I think let use blank string to re-present this for now.
We will eventually come back and revisit these trigger matcher down the line.
Can refer to this stack overflow question as well.
https://stackoverflow.com/questions/70403958/how-to-serialize-null-values-in-array
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.
I think "" works, as a placeholder for the 2nd item.
smartWalletAddress: wallet.address, | ||
status: WorkflowStatus.Active, | ||
id: submitResult, | ||
id, |
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.
the old test use WorkflowTemplate
but we created task with custom data (custom trigger with 102 block above), so i rewrote the test to adapt to this and pass right actual data/
@@ -250,6 +250,8 @@ describe("createWorkflow Tests", () => { | |||
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" | |||
&& trigger1.data.topics[2] == "${wallet.address}" | |||
`, | |||
// We don't need but the compare result look at its as a whole | |||
matcher: [], |
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.
okay, we need an empty array of matcher here.
@@ -306,7 +308,7 @@ describe("createWorkflow Tests", () => { | |||
type: TriggerType.Event, | |||
data: { | |||
matcher: [ | |||
{ type: "topics", value: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", null, "0x06DBb141d8275d9eDb8a7446F037D20E215188ff"] }, | |||
{ type: "topics", value: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "", "0x06DBb141d8275d9eDb8a7446F037D20E215188ff"] }, |
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.
I think "" works, as a placeholder for the 2nd item.
* v1.3.4-dev.0 * Removed matcher from EventTrigger * v0.9.4-dev.0 * v1.3.4-dev.1 * Revert "v0.9.4-dev.0" This reverts commit 0ad7ea2. * v1.3.4-dev.2 * Limit import of grpc library * Export node and trigger data type * v1.3.4-dev.3 * Revert "Removed matcher from EventTrigger" This reverts commit 6bb4a52. * Updated test utils for the compareResults() function * Moved GetKeyRequest and its message function to types * Moved GetKeyRequest types to the types package * Save the current progress of editing * --amend * Fix the tsbuild error caused by tsup * v0.9.4-dev.0 * v0.9.4-dev.1 * v0.9.4-dev.2 * Updated package release instructions in README * correct signatuee due to wrong indentation and fix failed test (#73) * correct signatuee due to wrong indentation * fix all test * rename * Break tests into suites in github actions * Break tests into suites in github actions (#76) * Separate local test on PR into multiple workflows * Upgrade npm versions of packages --------- Co-authored-by: Vinh <vinh@avaprotocol.org>
Update signature message
Update the test assertion to compare with the right value
Fix the null issue in array