Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Inheritance hierarchy not generated in JavaScript Cicero backend #644

Closed
jeromesimeon opened this issue Aug 26, 2019 · 1 comment
Closed
Assignees
Labels

Comments

@jeromesimeon
Copy link
Member

Describe the bug
The Cicero JavaScript backend does not include the type hierarchy, which is needed at run time for pattern matching.

To Reproduce

Compiling the helloworld template either for es6 or cicero:

bash-3.2$ ergoc ./models/*.cto ./lib/logic.ergo 
Compiling Ergo './lib/logic.ergo' --  './lib/logic.js'
bash-3.2$ ergoc ./models/*.cto ./lib/logic.ergo --target cicero
Compiling Ergo './lib/logic.ergo' --  './lib/logic_cicero.js'
bash-3.2$ head lib/logic.js 
/* Generated using ergoc version 0.9.4 */
'use strict';
/*eslint-disable no-unused-vars*/
/*eslint-disable no-undef*/
/*eslint-disable no-var*/


var inheritance = 
[{"sub": "org.accordproject.helloworld.HelloWorldClause", "sup": "org.accordproject.cicero.contract.AccordClause"}, {"sub": "org.accordproject.helloworld.HelloWorldClause", "sup": "org.accordproject.base.Asset"}, {"sub": "org.accordproject.helloworld.MyResponse", "sup": "org.accordproject.cicero.runtime.Response"}, {"sub": "org.accordproject.helloworld.MyResponse", "sup": "org.accordproject.base.Transaction"}, {"sub": "org.accordproject.helloworld.MyRequest", "sup": "org.accordproject.cicero.runtime.Request"}, {"sub": "org.accordproject.helloworld.MyRequest", "sup": "org.accordproject.base.Transaction"}, {"sub": "org.accordproject.ergo.stdlib.ErgoErrorResponse", "sup": "org.accordproject.cicero.runtime.ErrorResponse"}, {"sub": "org.accordproject.ergo.stdlib.ErgoErrorResponse", "sup": "org.accordproject.base.Transaction"}, {"sub": "org.accordproject.cicero.runtime.NotificationObligation", "sup": "org.accordproject.cicero.runtime.Obligation"}, {"sub": "org.accordproject.cicero.runtime.NotificationObligation", "sup": "org.accordproject.base.Event"}, {"sub": "org.accordproject.cicero.runtime.PaymentObligation", "sup": "org.accordproject.cicero.runtime.Obligation"}, {"sub": "org.accordproject.cicero.runtime.PaymentObligation", "sup": "org.accordproject.base.Event"}, {"sub": "org.accordproject.cicero.runtime.Obligation", "sup": "org.accordproject.base.Event"}, {"sub": "org.accordproject.cicero.runtime.ErrorResponse", "sup": "org.accordproject.base.Transaction"}, {"sub": "org.accordproject.cicero.runtime.Response", "sup": "org.accordproject.base.Transaction"}, {"sub": "org.accordproject.cicero.runtime.Request", "sup": "org.accordproject.base.Transaction"}, {"sub": "org.accordproject.cicero.contract.AccordClause", "sup": "org.accordproject.base.Asset"}, {"sub": "org.accordproject.cicero.contract.AccordContract", "sup": "org.accordproject.base.Asset"}, {"sub": "org.accordproject.cicero.contract.AccordParty", "sup": "org.accordproject.base.Participant"}, {"sub": "org.accordproject.cicero.contract.AccordContractState", "sup": "org.accordproject.base.Asset"}];

bash-3.2$ head lib/logic_cicero.js 
/* Generated using ergoc version 0.9.4 */
'use strict';
/*eslint-disable no-unused-vars*/
/*eslint-disable no-undef*/
/*eslint-disable no-var*/


/**
 * Execute the smart clause
 * @param {Context} context - the Accord context

The default target includes the inheritance variable, but the cicero one does not.

Expected behavior
Both should include the inheritance variable.

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

No branches or pull requests

1 participant