pragma solidity ^0.4.26; contract Thesis { struct HealthRecord { string ipfsHash; string prevIpfsHash; uint timestamp; } HealthRecord[] healthrecords; function exists(string hash) public view { } function addHealthRecord(string hash, string prevIpfsHash) public { healthrecords.push(HealthRecord(hash, prevIpfsHash, now)); } function getHealthRecords(uint[] indexes) public returns (string[], string[], uint[]) { string[] memory hashes = new string[](indexes.length); string[] memory prev_hashes = new string[](indexes.length); uint[] memory timestamps = new uint[](indexes.length); for (uint i = 0; i < indexes.length; i++) { HealthRecord storage healthrecord = healthrecords[indexes[i]]; hashes[i] = healthrecord.ipfsHash; prev_hashes[i] = healthrecord.prevIpfsHash; timestamps[i] = healthrecord.timestamp; } return (hashes, prev_hashes, timestamps); } }
0.4.26