Skip to content
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

Open
wants to merge 3 commits into
base: old_harbinger
Choose a base branch
from

Conversation

LikoIlya
Copy link
Collaborator

No description provided.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
: parserReturn is
block {
var tmp := unpackTmpOrDefault(s.tmp);
case tmp.state of [
Copy link
Collaborator

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);
Copy link
Collaborator

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?

Copy link
Collaborator Author

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);
Copy link
Collaborator

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?

Copy link
Collaborator Author

@LikoIlya LikoIlya Aug 10, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants