Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
feesParameters,
);
} catch (error) {
throw Error(`Smart contract error: ${error}`);
}
// Save the metadata of the new ipfsHash into the Ethereum metadata cache
await this.ethereumMetadataCache.saveDataIdMeta(ipfsHash, ethereumMetadata);
return {
content,
id: ipfsHash,
meta: {
ethereum: ethereumMetadata,
ipfs: { size: contentSize },
storageType: StorageTypes.StorageSystemType.ETHEREUM_IPFS,
timestamp: ethereumMetadata.blockTimestamp,
},
};
}
const metaData = Object.values(this.data).map(elem => {
return {
storageType: StorageTypes.StorageSystemType.IN_MEMORY_MOCK,
timestamp: elem.timestamp,
};
});
public async getData(): Promise {
const results = Object.values(this.data).map(data => String(data.content));
const dataIds = Object.keys(this.data);
const nowTimestampInSec = Utils.getCurrentTimestampInSecond();
return {
meta: {
lastTimestamp: nowTimestampInSec,
metaData: new Array(results.length).fill({
storageType: StorageTypes.StorageSystemType.IN_MEMORY_MOCK,
}),
},
result: {
data: results,
dataIds,
},
};
}
}