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

correct signatuee due to wrong indentation and fix failed test #73

Merged
merged 3 commits into from
Feb 6, 2025

Conversation

v9n
Copy link
Member

@v9n v9n commented Feb 6, 2025

Update signature message
Update the test assertion to compare with the right value
Fix the null issue in array

@v9n
Copy link
Member Author

v9n commented Feb 6, 2025

@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: [],
Copy link
Member Author

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.

Copy link
Member

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"] },
Copy link
Member Author

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

Copy link
Member

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,
Copy link
Member Author

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/

@v9n v9n changed the title correct signatuee due to wrong indentation correct signatuee due to wrong indentation and fix failed test Feb 6, 2025
@@ -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: [],
Copy link
Member

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"] },
Copy link
Member

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.

@chrisli30 chrisli30 merged commit f8ee1f6 into chris-add_toJson Feb 6, 2025
3 checks passed
@chrisli30 chrisli30 deleted the chris-add_toJson-fix branch February 6, 2025 18:15
chrisli30 added a commit that referenced this pull request Feb 6, 2025
* 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>
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.

2 participants