I am working on a Solidity Smart Contract (^0.5.10) where I want to return an array of Ratings
elements.
struct Ratings {
address restaurant
uint8 score
};
Since returning Rating[]
, string[]
, and bytes[]
from functions is still experimental, I was attempting to compress the struct into a byte22[]
and return that in a serialized format. But I don't know how to combine byteX
objects into another byteX
object.
I have 3 variables like so:
bytes20 address_string = BytesUtils.toBytes(restaurant.experience);
bytes1 separator = bytes1(";");
bytes1 rating = BytesUtils.toBytes(review.rating);
How can I combine them to create a byte22
?
returns (address[] restaurants, uint8[] scores)
. – user19510 Sep 1 '19 at 22:43