eos icon indicating copy to clipboard operation
eos copied to clipboard

DAWN-697 ⁃ Need to change abi_to_rc output of parameter names to use new syntax

Open thomasbcox opened this issue 8 years ago • 2 comments

The current behavior of abi_to_rc is to map a smart contract action's input parameters to identically named text strings in the stub Ricardian contract.

It also surrounds it with a dollar sign and a pair of single curly braces.

Two changes.

ONE: change the input parameter's surrounding text from ${ param } to {{ param }}. That is, drop the dollar sign and make it two (2) curly braces and a space.

TWO: When the ACTION has an input variable like "account" (which is a super generic word) we want all variables in the RICARDIAN side to have a name that starts with the parameter-name, and then append "Var" (upper case 'V', lowercase 'a' and 'r') so the input parameter "account" shows up as {{ accountVar }} on the stub Ricardian contract output.

thomasbcox avatar Mar 28 '18 20:03 thomasbcox

looks good in version d6c36336cc8eeb5efa180e15a86780602578864e:

command: python abi_to_rc.py ../../contracts/currency/currency.abi

output file: Fredriks-MacBook-Pro:abi_to_rc jiaendu$ cat ../../contracts/currency/currency-issue-rc.md

Action - {{ issue }}

This Contract is legally binding and can be used in the event of a dispute. Disputes shall be settled through the standard arbitration process established by EOS.IO.

Description

The {{ issue }} action...

Inputs and Input Types

The {{ issue }} action requires the following inputs and input types:

Action Input Input Type
{{ issue }} {{ toVar }}
{{ quantityVar }}
{{ memoVar }}
{{ account_name }}
{{ asset }}
{{ string }}

taokayan avatar Mar 29 '18 07:03 taokayan

Removing needs testing label since taokayan has verified this ticket

andriantolie avatar Mar 30 '18 15:03 andriantolie