ricardian-template-toolkit
ricardian-template-toolkit copied to clipboard
RTT fails with ABI versions 1.1 and some 1.0
The accepted ABI version is currently a subset of ABI version 1.0. This is problematic since EOSIO.CDT will produce ABIs that are ABI version 1.1 and will cause failure when try to use RTT. The ABI has have a fair amount of manual editing to get it to work with RTT, but even with that some ABIs still fail with various exceptions even though the ABI appears to be correct.
A couple of findings so far:
-
The JSON produced by
cleos
when pushing an action is not directly consumable by the RTT CLI tool for a couple of reasons. One, it expects a top-leveltransaction
element containing the transaction object rather than the transaction object itself being the top-level. Two, the actiondata
in the JSON is already in a serialized form when output bycleos
so the RTT does not know how to handle that. -
A number of contracts tested had problems due to containing invalid YAML in the metadata. This occurs mainly in cases where the
summary
metadata contains variables to be interpolated. the{ }
surrounding the variables is being processed by the YAML parser as an alternative dictionary syntax rather than a simple string. In this case, the entire string should be surrounded with' '
or" "
. For example:
Invalid: summary:A contract between {{ user1 }} and {{ user2 }}
Valid: summary:"A contract between {{ user1 }} and {{ user2 }}"
Accepted answer on this Stackoverflow question has a nice summary: https://stackoverflow.com/questions/19109912/do-i-need-quotes-for-strings-in-yaml
The may be some other problems still related to ABI version but the above explained most of the problems we've encountered. Will continue some more investigation, but if some additional details on the exact errors or the differences between 1.1 and 1.0 could be provided that would be a big help.
Some addition info. Have found that the ABI causing these error also contained Mustache syntax errors in some contract text. Primarily around the conditionals. The correct syntax is {{#if ...}}
whereas some places contain {{if ...}}
. There were also references to a non-existent if_variable_exists
helper. This is unnecessary as a simple {{#if var}}
performs the expected action.
Is there will be some improvements for 1.1v supporting?