Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
func getResult(id: String) = {
if (keyIsDefined(id) == false) then throwIdError(id) else {
let responsesCount = getResponsesCount(id)
let minResponsesCount = getMinResponsesCount(id)
if (responsesCount < minResponsesCount) then throw("Minimum oracles count not reached yet") else {
let result = calculateResult(id)
let ratingsDiff = getOracleRatingsDiff(id, result)
let resultKey = keyResult(id)
let resultDataEntry = StringEntry(resultKey, result)
let dataToWrite = cons(resultDataEntry, ratingsDiff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment