-
Notifications
You must be signed in to change notification settings - Fork 78
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
AgentConfig API is error prone #106
Comments
Thanks for the feedback. The builder itself already exists; https://github.com/dfinity/agent-rs/blob/next/ic-agent/src/agent/builder.rs#L4 (and is used in icx and dfx). We could have the This is fairly simple work, if you want to go ahead please open a PR. I'll probably be able to find some time later this week to fix this. |
Indeed, thanks for the pointer! Then I don't quite understand why
I'm not sure it's much different from the current state of affairs, the error will be still a runtime one, not compile time. |
Some historical reason, maybe a change in dfx or something. There was initially no builder, but now that there is a good one they shouldn't be public.
Right you are. Your way is better then. Thanks! |
Currently, AgentConfig is a bare struct with public fields implementing
Default
. This has 2 issues:pub(crate)
, removingDefault
and introducing a Builder initialized with required arguments, e.g.The text was updated successfully, but these errors were encountered: