Byont-Ventures / smart-contract-analysis-tools

0 stars 1 forks source link

feat: added template generation from json-file #27

Open Vitality-Booster opened 1 year ago

RickVM commented 1 year ago

BTW @Vitality-Booster, next time feel free to assign me as a reviewer when you have brewed something nice. That makes it easier for me to find this

Vitality-Booster commented 1 year ago

@RickVM I believe you may have misunderstood a little, how the program works at the moment. Right now it gets all the values from a hardcoded input.json file and constructs a full_report.md file by inserting the data from the json into the templates from the template folder. At the moment, as I understood, @enzoevers is working on making the "intermediate" data format that all reports will follow. And after that we will move to fetching the real data from smart contracts and converting them into the reports

enzoevers commented 1 year ago

Indeed. My JSON structure proposal is at https://github.com/Byont-Ventures/smart-contract-analysis-tools/pull/30. This PR from @Vitality-Booster is about generating a (markdown) document based on a JSON file with a similar structure using a template engine.

RickVM commented 1 year ago

AH, so it is more like a POC? And it will be implemented for reals after #30?

enzoevers commented 1 year ago

AH, so it is more like a POC? And it will be implemented for reals after #30?

That's correct.

Vitality-Booster commented 1 year ago

Something to look out for while further development:

There is no good explanation of why it happens, but when you convert the variables from json file (which are in camelCase) to Rust variables (which are snake_case), when you try to use these variables in the templates, the templates can only read those values in camelCase and if you try to use snake_case instead you will get an error. So, be careful.