-
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
Updated secret tests and added exectution validation #80
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
import * as avs_pb from "@/grpc_codegen/avs_pb"; | ||
// import * as avs_pb from "@/grpc_codegen/avs_pb"; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Workflow, Node classes are used to serialize and format data from grpc, but for Secret we don’t have complex needs, so this file is not used yet. |
||
export type SecretProps = { | ||
name: string; | ||
secret: string; | ||
workflowId?: string; | ||
orgId?: string; | ||
}; | ||
// export type SecretProps = { | ||
// name: string; | ||
// secret: string; | ||
// workflowId?: string; | ||
// orgId?: string; | ||
// }; | ||
|
||
class Secret implements SecretProps { | ||
name: string; | ||
secret: string; | ||
workflowId?: string; | ||
orgId?: string; | ||
// class Secret implements SecretProps { | ||
// name: string; | ||
// secret: string; | ||
// workflowId?: string; | ||
// orgId?: string; | ||
|
||
constructor(props: SecretProps) { | ||
this.name = props.name; | ||
this.secret = props.secret; | ||
this.workflowId = props.workflowId; | ||
this.orgId = props.orgId; | ||
} | ||
// constructor(props: SecretProps) { | ||
// this.name = props.name; | ||
// this.secret = props.secret; | ||
// this.workflowId = props.workflowId; | ||
// this.orgId = props.orgId; | ||
// } | ||
|
||
toRequest(): avs_pb.CreateOrUpdateSecretReq { | ||
const request = new avs_pb.CreateOrUpdateSecretReq(); | ||
// toRequest(): avs_pb.CreateOrUpdateSecretReq { | ||
// const request = new avs_pb.CreateOrUpdateSecretReq(); | ||
|
||
request.setName(this.name); | ||
request.setSecret(this.secret); | ||
if (this.orgId) { | ||
request.setOrgId(this.orgId); | ||
} | ||
if (this.workflowId) { | ||
request.setWorkflowId(this.workflowId); | ||
} | ||
// request.setName(this.name); | ||
// request.setSecret(this.secret); | ||
// if (this.orgId) { | ||
// request.setOrgId(this.orgId); | ||
// } | ||
// if (this.workflowId) { | ||
// request.setWorkflowId(this.workflowId); | ||
// } | ||
|
||
return request; | ||
} | ||
} | ||
// return request; | ||
// } | ||
// } | ||
|
||
export default Secret; | ||
// export default Secret; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,20 +218,6 @@ describe("Authentication Tests", () => { | |
expect(res2).toHaveProperty("factory", FACTORY_ADDRESS); | ||
}); | ||
|
||
test("getWallets works with options.authKey", async () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test has the exactly same name with the previous one, so I removed it. I think it’s trying to test a default value salt:0, but there’s already a salt:123 created from the previous tests. We don’t have a way to reset the smart wallet response array yet. |
||
const wallets = await client.getWallets({ authKey: authKeyViaAPI }); | ||
expect(wallets.length).toBeGreaterThanOrEqual(1); | ||
|
||
expect(wallets[0]).toHaveProperty("address"); | ||
expect(wallets[0]).toHaveProperty("salt", "0"); | ||
expect(wallets[0]).toHaveProperty("factory", FACTORY_ADDRESS); | ||
|
||
const wallets2 = await client.getWallets({ | ||
authKey: authKeyViaSignature, | ||
}); | ||
expect(wallets2.length).toBeGreaterThanOrEqual(1); | ||
}); | ||
|
||
test("createWorkflow works with options.authKey", async () => { | ||
const wallet = await client.getWallet( | ||
{ salt: "345" }, | ||
|
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 interface is changed to this style for Secret functions.