Merkle root is 32 bytes

This commit is contained in:
Mark Spanbroek 2023-11-22 12:47:31 +01:00 committed by markspanbroek
parent efafa43910
commit b625f0d519
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ struct Ask {
struct Content {
string cid; // content id, used to download the dataset
bytes merkleRoot; // merkle root of the dataset, used to verify storage proofs
bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs
}
enum RequestState {

View File

@ -3,7 +3,7 @@ const { keccak256, defaultAbiCoder } = ethers.utils
function requestId(request) {
const Ask = "tuple(int64, uint256, uint256, uint256, uint256, uint256, int64)"
const Content = "tuple(string, bytes)"
const Content = "tuple(string, bytes32)"
const Request =
"tuple(address, " + Ask + ", " + Content + ", uint256, bytes32)"
return keccak256(defaultAbiCoder.encode([Request], requestToArray(request)))