firefly
firefly copied to clipboard
Struct array be not retuen from custom smart contracts via created REST-API by FireFly.
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.
I cannot understand why "getFunction" don`t return Struct array. Could you help me please?
This is my simplified smartcontract code :
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;
}
}
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:
{
"": [
{
"tokenId": "integer",
"tokenNm": "string",
"createdAt": "integer",
},
{
"tokenId": "integer",
"tokenNm": "string",
"createdAt": "integer",
}
]
}
but effective output:
{
"output": [
{},
{}
]
}
Thanks for reporting this. Can you please confirm which version of FireFly you were running when you saw this behavior?
I will attempt to reproduce this report back here with what I find.
Thanks for reporting this. Can you please confirm which version of FireFly you were running when you saw this behavior?
=> I am using v1.0.2 FireFly
ff@ubuntu:~$ ff version
{
"Version": "v1.0.2",
"License": "Apache-2.0"
}