Change the cid from string to bytes

This commit is contained in:
Arnaud 2025-01-15 15:18:48 +01:00
parent 02e3b8d22b
commit f1e674f91c
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663
3 changed files with 3 additions and 3 deletions

View File

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

View File

@ -34,7 +34,7 @@ const exampleRequest = async () => {
collateral: 200,
},
content: {
cid: "zb2rhheVmk3bLks5MgzTqyznLu1zqGH5jrfTA1eAZXrjx7Vob",
cid: Buffer.from("zb2rhheVmk3bLks5MgzTqyznLu1zqGH5jrfTA1eAZXrjx7Vob"),
merkleRoot: Array.from(randomBytes(32)),
},
expiry: hours(1),

View File

@ -22,7 +22,7 @@ function askToArray(ask) {
}
function contentToArray(content) {
return [content.cid, content.merkleRoot]
return [content.cid.toString(), content.merkleRoot]
}
function requestToArray(request) {