-
Notifications
You must be signed in to change notification settings - Fork 14
Support pocket-ic v9 #317
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
Support pocket-ic v9 #317
Changes from all commits
4d14a0a
c0a553a
8fe57ce
5d6d586
bfa6066
c0646df
d04ebda
e44e567
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,14 +1,14 @@ | ||||||||||||||||||||||||||||||||
| import { Actor, HttpAgent } from "@dfinity/agent"; | ||||||||||||||||||||||||||||||||
| import { Actor, HttpAgent } from "@icp-sdk/core/agent"; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| // Imports and re-exports candid interface | ||||||||||||||||||||||||||||||||
| import { idlFactory } from './storage.did.js'; | ||||||||||||||||||||||||||||||||
| export { idlFactory } from './storage.did.js'; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||
| * @param {string | import("@dfinity/principal").Principal} canisterId Canister ID of Agent | ||||||||||||||||||||||||||||||||
| * @param {{agentOptions?: import("@dfinity/agent").HttpAgentOptions; actorOptions?: import("@dfinity/agent").ActorConfig}} [options] | ||||||||||||||||||||||||||||||||
| * @return {import("@dfinity/agent").ActorSubclass<import("./storage.did.js")._SERVICE>} | ||||||||||||||||||||||||||||||||
| * @param {string | import("@icp-sdk/core/principal").Principal} canisterId Canister ID of Agent | ||||||||||||||||||||||||||||||||
| * @param {{agentOptions?: import("@icp-sdk/core/agent").HttpAgentOptions; actorOptions?: import("@icp-sdk/core/agent").ActorConfig}} [options] | ||||||||||||||||||||||||||||||||
| * @return {import("@icp-sdk/core/agent").ActorSubclass<import("./storage.did.js")._SERVICE>} | ||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||
|
Comment on lines
7
to
12
Contributor
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. JSDoc and runtime options out of sync with d.ts The JSDoc omits - * @param {{agentOptions?: import("@icp-sdk/core/agent").HttpAgentOptions; actorOptions?: import("@icp-sdk/core/agent").ActorConfig}} [options]
- * @return {import("@icp-sdk/core/agent").ActorSubclass<import("./storage.did.js")._SERVICE>}
+ * @param {{agent?: import("@icp-sdk/core/agent").Agent; agentOptions?: import("@icp-sdk/core/agent").HttpAgentOptions; actorOptions?: import("@icp-sdk/core/agent").ActorConfig}} [options]
+ * @return {import("@icp-sdk/core/agent").ActorSubclass<import("./storage.did.js")._SERVICE>}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
| export const createActor = (canisterId, options) => { | ||||||||||||||||||||||||||||||||
| const agent = new HttpAgent({ ...options?.agentOptions }); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
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.
🛠️ Refactor suggestion
Close server on client init failure and load Mops flavor dynamically.
Prevents orphaned processes if create() throws and avoids hard dependency on pic-js-mops when using v4.
📝 Committable suggestion
🤖 Prompt for AI Agents