-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Labels
Code HealthRefactors and improvements to the structure of the codeRefactors and improvements to the structure of the codegood first issueGood for newcomersGood for newcomers
Milestone
Description
As is: we have a monolith main
function that performs all parsing and creates a simulation.
Motivation: if using simln as a library, it would be nice to have a parsing module in sim-cli/src/parsing.rs
to pull in some of the parsing/validation that main currently performs.
Some suggestions for things that we can pull out in a refactor:
Cli
: move into module so that it can be re-used externally- SimParams: move to parsing module (it doesn't belong in the lib) (also move
NodeConnection
andActivityParser
) get_clients
: builds the map ofdyn LightningNode
that'll be passed to the simulationvalidate_activities
: performsActivityParser
->ActivityDefinition
conversionread_sim_path
: this is a nice to have frill, might as well make it accessible for other folks
The only thing that's tricky here is that validate_activities
needs to make calls to our dyn LightningNode
to validate that pubkeys exist in their graph, so that needs to be threaded through. Ideally this could just be a generic closure that looks up the node, but it gets ugly when you start dealing with async closures (I briefly tried this in the past and gave up).
Metadata
Metadata
Assignees
Labels
Code HealthRefactors and improvements to the structure of the codeRefactors and improvements to the structure of the codegood first issueGood for newcomersGood for newcomers