hyperledger-firefly / hyperledger-firefly/firefly
Struct array be not retuen from custom smart contracts via created REST-API by FireFly.
- Dominant language
- Go
- Stars
- 602
- Forks
- 246
- Avg merge
- 18h 47m
- Merged PRs (30d)
- 6
Description
I deployed custom smart contracts to Quorum on FireFly using truffle.
And I have generated REST-API for the contract using FireFly API.
I cannot get expected output from "getFunction"(below src) which return Struct array(Definitions.CustomToken[]).
But I can get expected output from another function which return Definitions.CustomToken.
This behavior is similar to [another issue](https://github.com/hyperledger/firefly/issues/828).
I cannot understand why "getFunction" don`t return Struct array.
Could you help me please?
This is my simplified smartcontract code :
```sol
pragma solidity >=0.4.22 <0.9.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./Definitions.sol";
contract Logic is ERC721Enumerable {
function getFunction(uint256[] memory Ids)
public
view
returns (Definitions.CustomToken[] memory)
{
// (abridgement) get or create Definitions.CustomToken[]
return tokenList;
}
}
```
```sol
pragma solidity >=0.4.22 <0.9.0;
contract Definitions {
struct CustomToken {
uint256 tokenId;
string tokenNm;
uint256 createdAt;
}
}
```
expected output from REST-API for the contract:
```json
{
"": [
{
"tokenId": "integer",
"tokenNm": "string",
"createdAt": "integer",
},
{
"tokenId": "integer",
"tokenNm": "string",
"createdAt": "integer",
}
]
}
```
but effective output:
````json
{
"output": [
{},
{}
]
}
````
Contributor guide
Assessment
This issue has not been assessed yet.