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

Pt 166233685 fate oracles #2515

Merged
merged 2 commits into from
Jun 19, 2019

Conversation

gorillainduction
Copy link
Contributor

Implement oracle query instruction and object

Implement oracle get question in fate

Implement oracle query fee in fate

Implement oracle get answer in fate

Implement oracle respond in fate

Implement oracle extend in fate
Copy link
Member

@hanssv hanssv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I think the level git conflicts should be manageble

@@ -1750,7 +1775,10 @@ sophia_oracles(_Cfg) ->
Ct1 = ?call(create_contract, Acc, oracles, {}, #{amount => 1000000}),
QuestionType = {variant_t, [{why, [word]}, {how, [string]}]},
AnswerType = {variant_t, [{noAnswer, []}, {yesAnswer, [QuestionType, string, word]}]},
Question1 = {variant, 1, [<<"birds fly?">>]},
Question1 = case ?IS_FATE_SOPHIA(vm_version()) of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use IF_AEVM?

-define(CHAIN_ABSOLUTE_TTL_MEMORY_ENCODING_TYPE(X), tuple()).

-define(CHAIN_RELATIVE_TTL_MEMORY_ENCODING(X),
case ?IS_FATE_SOPHIA(vm_version()) of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shorter with ?IF_AEVM

@@ -1777,11 +1807,13 @@ sophia_oracles_type_error_out(_Cfg) ->
Ct = <<CtId:256>> = ?call(create_contract, Acc, oracles, {}, #{amount => 100000}),
QueryFee = 100,
TTL = 15,
CtId = ?call(call_contract, Acc, Ct, registerStringStringOracle, word, {CtId, QueryFee, FixedTTL(TTL)}),
Oracle = ?call(call_contract, Acc, Ct, registerStringStringOracle, word, {Ct, QueryFee, FixedTTL(TTL)}),
?assertMatchAEVM(CtId, Oracle),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just ?assertMatchVM perhaps?

@gorillainduction gorillainduction changed the base branch from master to FATE-codefreeze-master June 19, 2019 09:06
@gorillainduction
Copy link
Contributor Author

@hanssv @UlfNorell I changed the base branch to a temporary master branch.

@gorillainduction gorillainduction merged commit dc461cf into FATE-codefreeze-master Jun 19, 2019
@gorillainduction gorillainduction deleted the PT-166233685-fate-oracles branch June 19, 2019 09:09
happi pushed a commit that referenced this pull request Jun 20, 2019
* Handle oracles in fate

Implement oracle query instruction and object

Implement oracle get question in fate

Implement oracle query fee in fate

Implement oracle get answer in fate

Implement oracle respond in fate

Implement oracle extend in fate

* Add stub for not yet implemented op
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants