diff --git a/tests/handlers/records-write.spec.ts b/tests/handlers/records-write.spec.ts index 30134c3a7..17c6acce1 100644 --- a/tests/handlers/records-write.spec.ts +++ b/tests/handlers/records-write.spec.ts @@ -3009,6 +3009,7 @@ export function testRecordsWriteHandler(): void { // bob learns of metadata (ie. dataCid) of alice's secret data, // attempts to gain unauthorized access by writing to alice's DWN through open protocol referencing the dataCid without supplying the data + // which he is allowed to do, the DWN will treat the operation as an initial-write or a record that has a later and different state. const imageRecordsWrite = await TestDataGenerator.generateRecordsWrite({ author : bob, protocol, @@ -3019,7 +3020,7 @@ export function testRecordsWriteHandler(): void { dataSize, recipient : alice.did }); - const imageReply = await dwn.processMessage(alice.did, imageRecordsWrite.message, { dataStream: imageRecordsWrite.dataStream }); + const imageReply = await dwn.processMessage(alice.did, imageRecordsWrite.message); expect(imageReply.status.code).to.equal(204); // allows write but is not readable or queryable // verify the record is not able to be read @@ -3101,6 +3102,7 @@ export function testRecordsWriteHandler(): void { // bob learns of metadata (ie. dataCid) of alice's secret data, // attempts to gain unauthorized access by writing to alice's DWN through open protocol referencing the dataCid without supplying the data + // which he is allowed to do, the DWN will treat the operation as an initial-write or a record that has a later and different state. const imageRecordsWrite = await TestDataGenerator.generateRecordsWrite({ author : bob, protocol, @@ -3111,7 +3113,7 @@ export function testRecordsWriteHandler(): void { dataSize, recipient : alice.did }); - const imageReply = await dwn.processMessage(alice.did, imageRecordsWrite.message, { dataStream: imageRecordsWrite.dataStream }); + const imageReply = await dwn.processMessage(alice.did, imageRecordsWrite.message); expect(imageReply.status.code).to.equal(204); // allows write but is not readable or queryable // verify the record is not able to be read diff --git a/tests/utils/test-data-generator.ts b/tests/utils/test-data-generator.ts index 12b358469..e777eef07 100644 --- a/tests/utils/test-data-generator.ts +++ b/tests/utils/test-data-generator.ts @@ -396,6 +396,7 @@ export class TestDataGenerator { /** * Generates a RecordsWrite message for testing. + * `dataBytes` & `dataStream` returned will be `undefined` as long as `dataCid` or `dataSize` is given. * Implementation currently uses `RecordsWrite.create()`. * @param input.attesters Attesters of the message. Will NOT be generated if not given. * @param input.data Data that belongs to the record. Generated when not given only if `dataCid` and `dataSize` are also not given.