-
Notifications
You must be signed in to change notification settings - Fork 123
Description
#2292 introduced the ownable2step component and a Ownable2Step struct. This struct is not an account component yet, but could be to not require re-exporting its procedures from components that build on top of it, like NetworkFungibleFaucet.
What's missing is basically an impl From<Ownable2Step> for AccountComponent { ... }, and removing the re-exports from NetworkFungibleFaucet.
NetworkFungibleFaucet depends on the presence of Ownable2Step (as it calls ownable2step::assert_sender_is_owner). So, whenever building an account with NetworkFungibleFaucet, one would also have to provide Ownable2Step.
For now, failing to do so would fail with a when executing transactions (missing ownership config slot), but eventually, we can express such dependencies in an AccountComponentInterface (different from the one we have now), e.g. NetworkFungibleFaucet::dependencies would return Ownable2Step::NAME (see also #1394 (comment)). Failing to provide Ownable2Step then would fail when building the account.
Then, it should become even easier to reuse Ownable2Step and integrate it with other components.
Tasks:
-
impl From<Ownable2Step> for AccountComponent. - Remove ownable2step MASM procedure re-exports from
NetworkFungibleFaucetand remove theownershipfield fromNetworkFungibleFaucet. - Update
create_network_fungible_faucetand other call sites that build aNetworkFungibleFaucetto also provide aOwnable2Step.
cc @afa7789 @onurinanc in case you have thoughts