arbiter icon indicating copy to clipboard operation
arbiter copied to clipboard

Abstract functionality out of main.

Open Autoparallel opened this issue 3 years ago • 3 comments

We should make all of the functionality in main as simple as possible so that it is just clap. For example, for sim we have this snippet:

async fn main() -> Result<(), Box<dyn Error>> {
    let args = Args::parse();

    match &args.command {
        Some(Commands::Sim { config: _ }) => {
            sim::sim()?;
        }
 }

This will let us grow the cli handling without making main unbelievably large. For each leg of the match &args.command, make each a single line command like sim::sim()?.

  • [x] Move the logic for chain out of main.rs and into chain.rs.
  • [x] Move the logic of gbm out of main.rs and into gbm.rs.
  • [x] Move the logic of ou out of main.rs and into ou.rs.

Autoparallel avatar Apr 18 '23 05:04 Autoparallel

@0xEstelle I think you can take care of the tasks 2 and 3 here with your branch.

Autoparallel avatar Apr 21 '23 13:04 Autoparallel

Def can!! Currently i have all the price processes defined in one file price_process.rs. are you thinking of isolating one each to its own file?

FiberedSkies avatar Apr 21 '23 13:04 FiberedSkies

done

FiberedSkies avatar Apr 22 '23 17:04 FiberedSkies