AgeManning / EthereumMiningCalculator

Advanced statistics for mining ethereum and other cryptocurrencies.
https://thecalc.io
16 stars 11 forks source link

Entry Validation #14

Closed AgeManning closed 8 years ago

AgeManning commented 8 years ago

Validate entries before running calculate.

AgeManning commented 8 years ago

Paul, can you make an example function of how you want validation handled to notify the user in the UI. I can then extend it to all elements, if you set up the basic framework.

AgeManning commented 8 years ago

Validation Seems to work. Returns a list of strings which are names of userInputs. We need to deal with these in the UI. See forecaster-service factory.calculate().

Can test with this url: http://localhost:9001/#/forecaster?cryptocurrency=eth&complexityType=advanced&hashRate=100&difficultyType=linear&cryptoPriceCode=AUD&currentDifficulty=60.172538242002325&blockTime=-15&blockReward=-5&minerExpenseInclusion=enable&initialInvestment=-1000&electricityUsage=-5&electricityRate=-58&plotDays=-89&plotResolution=1&predictionVariables=%5Bobject%20Object%5D&predictiveDifficultyAValue=0#forecaster-inputs

paulhauner commented 8 years ago

I've added in the code for this - input directives can know when they are invalid.