-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add state machine to callback harbinger #11
base: old_harbinger
Are you sure you want to change the base?
Conversation
: parserReturn is | ||
block { | ||
var tmp := unpackTmpOrDefault(s.tmp); | ||
case tmp.state of [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require(tmp.state = Idle, Errors.invalidState)
price = oraclePrice; | ||
level = Tezos.level; | ||
updating = False; | ||
var data := unpackTmp(s.tmp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be merged with line 103?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
priceF := s.oraclePrecision * precision / oraclePrice; | ||
data.price := oraclePrice; | ||
data.level := Tezos.level; | ||
data.state := WaitingAssetPrice(0n); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how this works.
Isn't the number in payload supposed to be total count of callbacks we expect to be invoked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, num in payload describes current state and index. Field size
is responsible for storing count of callbacks
No description provided.