#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:
cc @afa7789 @onurinanc in case you have thoughts
#2292 introduced the ownable2step component and a
Ownable2Stepstruct. 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, likeNetworkFungibleFaucet.What's missing is basically an
impl From<Ownable2Step> for AccountComponent { ... }, and removing the re-exports fromNetworkFungibleFaucet.NetworkFungibleFaucetdepends on the presence ofOwnable2Step(as it callsownable2step::assert_sender_is_owner). So, whenever building an account withNetworkFungibleFaucet, one would also have to provideOwnable2Step.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::dependencieswould returnOwnable2Step::NAME(see also #1394 (comment)). Failing to provideOwnable2Stepthen would fail when building the account.Then, it should become even easier to reuse
Ownable2Stepand integrate it with other components.Tasks:
impl From<Ownable2Step> for AccountComponent.NetworkFungibleFaucetand remove theownershipfield fromNetworkFungibleFaucet.create_network_fungible_faucetand other call sites that build aNetworkFungibleFaucetto also provide aOwnable2Step.cc @afa7789 @onurinanc in case you have thoughts