-
Notifications
You must be signed in to change notification settings - Fork 3.7k
get table array values not being returned #2350
Comments
@wanderingbort I think it is calling "DataStream& operator << ( DataStream& ds, const std::array<T,N>& v )" which is more efficient for packing/unpacking in contracts, but there is nothing on the abi that could handle this (since no size is stored in the packed format and we don't have anything in the abi that indicates a fixed size array). The easiest solution to this is to change the implementation of "DataStream& operator << ( DataStream& ds, const std::array<T,N>& v )" to match vector, which is not as efficient, but not terribly. Harder solution is extending the abi to include "yyyy[#]" where # indicates the fixed size of the array and passes that size along with the pack/unpack to indicate size to read/write. |
Handling this by implementing operator<< for std::array and adding one for "T (&v)[N}" and using a similar implementation to std::vector so that there is a size for abi serializer to use to size the vector that it will allocate to handle all of these types. |
…so that abi serializer can serialize both types the same way. GH EOSIO#2350
…s are packed/unpacked according to the abi definition and cleanup of tests. GH EOSIO#2350
Played the tic_tac_toe contract and can verify for each step the board is printed properly by cleos get table command |
Specific example is tic_tac_toe tutorial, "get table" returns:
{
"rows": [{
"challenger": "player2",
"host": "player1",
"turn": "player2",
"winner": "none",
"board": []
}
],
"more": false
}
even though board is a uint8_t[9] and has values
The text was updated successfully, but these errors were encountered: