In the abi, we also have a type named "recharge" whose structure is totally different from that of "dorecharge":
"name": "recharge",
"base": "",
"fields": [
//lots of field definition
.....
]
Now we have a action "recharge" whose data structure meets "dorecharge" and we put this action data to fcbuffer. In structs.js/actionDataFromObject, the structLookup will take "recharge" as param :
var fields = _ref5.fields,
object = _ref5.object,
result = _ref5.result;
var data = object.data,
name = object.name;
var ser = (name || '') == '' ? fields.data : structLookup(name, object.account);
Then the ser will process action data(based on "dorecharge") based on a totally different structure ("recharge")
I believe that when an action arrives at fc, fc should choose struct based on action.type instead of action.name. The code should search for the abi to fetch the action type per name , then pass the type to structLookup.
Hi,
I met some problem when serializing aciton.data in the case of action.name != action.type.
Suppose we have an abi def who has an action def meeting the condition action.name != action.type:
"actions": [{ "name": "recharge", "type": "dorecharge", "ricardian_contract": "" }]
In the abi, we also have a type named "recharge" whose structure is totally different from that of "dorecharge":
"name": "recharge", "base": "", "fields": [ //lots of field definition ..... ]
Now we have a action "recharge" whose data structure meets "dorecharge" and we put this action data to fcbuffer. In structs.js/actionDataFromObject, the structLookup will take "recharge" as param :
var fields = _ref5.fields, object = _ref5.object, result = _ref5.result; var data = object.data, name = object.name;
Then the ser will process action data(based on "dorecharge") based on a totally different structure ("recharge")
I believe that when an action arrives at fc, fc should choose struct based on action.type instead of action.name. The code should search for the abi to fetch the action type per name , then pass the type to structLookup.