fix: broken example code, incorrect docs, and typos#3
Open
golldyck wants to merge 1 commit intoOpenGradient:mainfrom
Open
fix: broken example code, incorrect docs, and typos#3golldyck wants to merge 1 commit intoOpenGradient:mainfrom
golldyck wants to merge 1 commit intoOpenGradient:mainfrom
Conversation
Author
|
Hi @adambalogh @kylexqian — this PR fixes bugs I found during a full audit of OpenGradient's public repositories. Would appreciate a review when you get a chance. Happy to address any feedback. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
examples/run_historical.solfile cannot compile due to 5 errors: wrong import path, non-existent function name, undefined variable, missing struct field, and undeclared state variables. The README.md has matching errors plus missingmemorykeywords and broken links.Fix
Corrected all compilation errors in the example contract, fixed README code snippets to match the actual interface definitions, and fixed NatSpec typos in the interface files. Removed a redundant
uint32 >= 0gas-wasting check in TensorLib.Changes
examples/run_historical.sol— Fixed import path (../lib/→../src/lib/), renamedrunHistoricalInference→runInferenceOnPriceFeed, fixedinput_query→input, addedcandle_duration_in_minsfield, declaredresultsandresultNumbervariablesREADME.md— Fixed function names, added missing struct fields, addedmemorykeyword to struct assignments, prefixed URLs withhttps://src/interfaces/OGInference.sol— Fixed NatSpec typo "OGInfernece" → "OGInference"src/interfaces/OGHistorical.sol— Fixed copy-paste NatSpec "OGInference" → "OGHistorical"src/lib/TensorLib.sol— Removed redundantuint32 >= 0checkTesting
examples/run_historical.solcompiles without errorssrc/interfaces/definitionsCloses #4