Anoma.Node.Examples.ESolver (Anoma v0.29.0)
I contain several examples on how to use the solver.
Summary
Functions
I send a trivial transaction to the Intent Pool, which then gets solved by itself and then sent to the Mempool to be executed.
I insert a single transaction into the solver, which it cannot solve. I verify that the transaction is then in the unsolved list.
I create a single transaction and ask the solver to solve it. The transaction cannot be solved, so it should be in the unbalanced list when the solver returns.
I solve multiple intents that are valid when composed.
I solve multiple intents that are valid when composed.
Functions
solvable_transaction_gets_executed(enode \\ ENode.start_node())
@spec solvable_transaction_gets_executed(Anoma.Node.Examples.ENode.t()) :: :ok
I send a trivial transaction to the Intent Pool, which then gets solved by itself and then sent to the Mempool to be executed.
solvable_transaction_via_intent_pool(enode \\ ENode.start_node())
@spec solvable_transaction_via_intent_pool(Anoma.Node.Examples.ENode.t()) :: boolean()
I insert a single transaction into the solver, which it cannot solve. I verify that the transaction is then in the unsolved list.
solve_transaction()
@spec solve_transaction() :: boolean()
I create a single transaction and ask the solver to solve it. The transaction cannot be solved, so it should be in the unbalanced list when the solver returns.
solve_transactions()
@spec solve_transactions() :: boolean()
I solve multiple intents that are valid when composed.
solve_transactions_with_remainder()
@spec solve_transactions_with_remainder() :: boolean()
I solve multiple intents that are valid when composed.