-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Was initially discussed in aeternity/aesophia#351
I propose to decode returned value to Number instead of BigInt if calldata finds a shortint (not sure about name) aliased to int while type resolving.
For example for the contract
contract C =
type shortint = int
record rec = { x: shortint }
entrypoint f(s : shortint) : shortint =
s * 42
entrypoint f2() : rec =
{ x = 42 }
ACI would be
[
{
"contract": {
"functions": [
{
"arguments": [
{
"name": "s",
"type": "C.shortint"
}
],
"name": "f",
"payable": false,
"returns": "C.shortint",
"stateful": false
},
{
"arguments": [],
"name": "f2",
"payable": false,
"returns": "C.rec",
"stateful": false
}
],
"kind": "contract_main",
"name": "C",
"payable": false,
"typedefs": [
{
"name": "shortint",
"typedef": "int",
"vars": []
},
{
"name": "rec",
"typedef": {
"record": [
{
"name": "x",
"type": "C.shortint"
}
]
},
"vars": []
}
]
}
}
]And it looks like ACI preserves enough info to track int alias even in complex structures. Of course, this feature is not urgent.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels