andromedaprotocol / andromeda-core

Operating System and ADO Smart Contracts
https://andromedaprotocol.io/
38 stars 27 forks source link

Enhance/ExecuteContext, and all the functions that require the argument - deps #536

Open mdjakovic0920 opened 2 months ago

mdjakovic0920 commented 2 months ago

Description

The current implementation of ExecuteContext::new is suitable for already built ADOs. The functionality of this is to make an instance of execute context from deps, env, info.

By the way, the type of deps is DepsMut and its CustomQuery is Empty as a default. And the already built founctions are implemented the type of deps as DepsMut with CustomQuery = Empty . This implementation limits its utility in custom ADO that requires deps with not empty CustomQuery.

For example, To implement the custom ADO that sends orders to Injective Orderbook, for quering from injective, it needs the type of deps as DepsMut<InjectiveQueryWrapper>. Here the generic CustomQuery is InjectiveQueryWrapper. In this case, ExecuteContext::new requires argument deps with empty CustomQuery, so it occurs an error.

Implementation

To address this, enhancing ExecuteContext, and all the functions that require the argument deps with generic CustomQuery.

Acceptance Criteria

All the functions that require the argument deps should support CustomQuery as a random generic query.