-
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
update the new auth method and trigger matcher array #56
Conversation
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.
Added comments.
tests/templates.ts
Outdated
@@ -19,6 +19,8 @@ import { NodeType } from "@avaprotocol/types"; | |||
export const FACTORY_ADDRESS = "0x29adA1b5217242DEaBB142BC3b1bCfFdd56008e7"; | |||
export const EXPIRED_AT = Math.floor(Date.now() / 1000) + 24 * 60 * 60; // 24 hours from now | |||
|
|||
export const defaultTriggerId = `trigger${getNextId()}`; |
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.
Do we need a trigger
prefix to the id of a trigger?
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.
no we dont. this is just test. let me know if you want to remvoe it. i put it to easily found in in console log when develop locally. so hard to know which is which with all the uuid. because now we use uuid all so hard to know whether a uuid belong to trigger or node.
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.
Right, we need to store that in a variable. The fix looks good.
apiKey: string, | ||
expiredAtEpoch: number, | ||
): Promise<KeyRequest> { | ||
const chainId = CHAIN_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.
I think the chainId needs to be passed in, but not a const.
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.
tests/utils.ts
Outdated
|
||
return signature; | ||
// Helper function to generate api key message | ||
export async function generateAuthPayloadWithApiKey( |
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 function doesn’t need the async
keyword.
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.
Is this func used only by the authWithAPIKey
? I think it can be merged into the authWithAPIKey
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 function doesn’t need the async keyword.
Will remove. I fetch the Chain ID dynamically from the RPC before but it make the test a bit slower than normal so i revert to setting the Chain ID together with the chain endpoint
Is this func used only by the authWithAPIKey? I think it can be merged into the authWithAPIKey
hmm, this function is inside tests/utils.ts
for testing purpose...
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.
Right, sorry I thought it was in source code. Then this is fine.
@chrisli30 please review again |
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.
Nice, all comments are addressed.
No description provided.