Open mitinarseny opened 5 months ago
@mitinarseny I think there is no meaning for #[init]
in the traits. Does it work if you don't put #[init]
there?
Does it work if you don't put #[init] there?
Apparently, #[near]
requires #[init]
on all methods returning Self
. Constructors usually do that
I think there is no meaning for #[init] in the traits
I respectfully disagree as it can be helpful if you want to write a Deployer
contract which would be responsible for deploying other contracts, so one can use bindings for constructors of these contracts as well.
With that being said, it still wouldn't let you to write a Deployer
contract that would deploy another contract and call #[init]
method on it, as the current implementation of #[ext_contract]
generates the code that creates Promise
internally and doesn't let you to insert any other actions (such as .deploy(wasm)
) prior to the function call itself.
Hey Team,
The #1001 fix makes it impossible to define a trait with
#[init]
method that returnsSelf
:as it expands into
And results into following error: