diff --git a/test/suites/integration/bsp/multi-volunteer-3.test.ts b/test/suites/integration/bsp/multi-volunteer-3.test.ts index 9606c092..4dcdc268 100644 --- a/test/suites/integration/bsp/multi-volunteer-3.test.ts +++ b/test/suites/integration/bsp/multi-volunteer-3.test.ts @@ -53,7 +53,7 @@ describeBspNet("BSPNet: Mulitple BSP Volunteering - 3", ({ before, it, createUse assert(newBucketEventDataBlob, "Event doesn't match Type"); - const fileMetadata = await api.rpc.storagehubclient.loadFileInStorage( + const { file_metadata: fileMetadata } = await api.rpc.storagehubclient.loadFileInStorage( "res/cloud.jpg", "cat/cloud.jpg", signer.address, diff --git a/test/suites/integration/bsp/multi-volunteer.test.ts b/test/suites/integration/bsp/multi-volunteer.test.ts index f4c170be..f10c2c82 100644 --- a/test/suites/integration/bsp/multi-volunteer.test.ts +++ b/test/suites/integration/bsp/multi-volunteer.test.ts @@ -25,7 +25,7 @@ describeBspNet("BSPNet: Mulitple BSP Volunteering - 1", ({ before, it, createUse assert(newBucketEventDataBlob, "Event doesn't match Type"); - const fileMetadata = await api.rpc.storagehubclient.loadFileInStorage( + const { file_metadata: fileMetadata } = await api.rpc.storagehubclient.loadFileInStorage( "res/smile.jpg", "cat/smile.jpg", signer.address, diff --git a/test/suites/integration/bsp/multiple-delete.test.ts b/test/suites/integration/bsp/multiple-delete.test.ts index e6ef2599..f3f57c28 100644 --- a/test/suites/integration/bsp/multiple-delete.test.ts +++ b/test/suites/integration/bsp/multiple-delete.test.ts @@ -37,13 +37,14 @@ describeBspNet("Single BSP Volunteering", ({ before, createBspApi, it, createUse const files = []; const txs = []; for (let i = 0; i < source.length; i++) { - const { fingerprint, file_size, location } = - await userApi.rpc.storagehubclient.loadFileInStorage( - source[i], - destination[i], - userApi.shConsts.NODE_INFOS.user.AddressId, - newBucketEventDataBlob.bucketId - ); + const { + file_metadata: { location, fingerprint, file_size } + } = await userApi.rpc.storagehubclient.loadFileInStorage( + source[i], + destination[i], + userApi.shConsts.NODE_INFOS.user.AddressId, + newBucketEventDataBlob.bucketId + ); files.push({ fingerprint, file_size, location }); txs.push( @@ -172,13 +173,14 @@ describeBspNet("Single BSP Volunteering", ({ before, createBspApi, it, createUse const files = []; const txs = []; for (let i = 0; i < source.length; i++) { - const { fingerprint, file_size, location } = - await userApi.rpc.storagehubclient.loadFileInStorage( - source[i], - destination[i], - userApi.shConsts.NODE_INFOS.user.AddressId, - newBucketEventDataBlob.bucketId - ); + const { + file_metadata: { location, fingerprint, file_size } + } = await userApi.rpc.storagehubclient.loadFileInStorage( + source[i], + destination[i], + userApi.shConsts.NODE_INFOS.user.AddressId, + newBucketEventDataBlob.bucketId + ); files.push({ fingerprint, file_size, location }); txs.push( diff --git a/test/suites/integration/bsp/single-volunteer.test.ts b/test/suites/integration/bsp/single-volunteer.test.ts index f9b2d143..d21c2a9f 100644 --- a/test/suites/integration/bsp/single-volunteer.test.ts +++ b/test/suites/integration/bsp/single-volunteer.test.ts @@ -31,13 +31,14 @@ describeBspNet("Single BSP Volunteering", ({ before, createBspApi, it, createUse throw new Error("Event doesn't match Type"); } - const { location, fingerprint, file_size } = - await userApi.rpc.storagehubclient.loadFileInStorage( - source, - destination, - userApi.shConsts.NODE_INFOS.user.AddressId, - newBucketEventDataBlob.bucketId - ); + const { + file_metadata: { location, fingerprint, file_size } + } = await userApi.rpc.storagehubclient.loadFileInStorage( + source, + destination, + userApi.shConsts.NODE_INFOS.user.AddressId, + newBucketEventDataBlob.bucketId + ); strictEqual(location.toHuman(), destination); strictEqual(fingerprint.toString(), userApi.shConsts.TEST_ARTEFACTS[source].fingerprint); @@ -62,13 +63,14 @@ describeBspNet("Single BSP Volunteering", ({ before, createBspApi, it, createUse assert(newBucketEventDataBlob, "Event doesn't match Type"); - const { fingerprint, file_size, location } = - await userApi.rpc.storagehubclient.loadFileInStorage( - source, - destination, - userApi.shConsts.NODE_INFOS.user.AddressId, - newBucketEventDataBlob.bucketId - ); + const { + file_metadata: { location, fingerprint, file_size } + } = await userApi.rpc.storagehubclient.loadFileInStorage( + source, + destination, + userApi.shConsts.NODE_INFOS.user.AddressId, + newBucketEventDataBlob.bucketId + ); await userApi.sealBlock( userApi.tx.fileSystem.issueStorageRequest( @@ -183,13 +185,14 @@ describeBspNet("Single BSP multi-volunteers", ({ before, createBspApi, createUse const txs = []; for (let i = 0; i < source.length; i++) { - const { fingerprint, file_size, location } = - await userApi.rpc.storagehubclient.loadFileInStorage( - source[i], - destination[i], - userApi.shConsts.NODE_INFOS.user.AddressId, - newBucketEventDataBlob.bucketId - ); + const { + file_metadata: { location, fingerprint, file_size } + } = await userApi.rpc.storagehubclient.loadFileInStorage( + source[i], + destination[i], + userApi.shConsts.NODE_INFOS.user.AddressId, + newBucketEventDataBlob.bucketId + ); txs.push( userApi.tx.fileSystem.issueStorageRequest( diff --git a/test/suites/integration/msp/debt-collection.test.ts b/test/suites/integration/msp/debt-collection.test.ts index 1bf002ca..84d729db 100644 --- a/test/suites/integration/msp/debt-collection.test.ts +++ b/test/suites/integration/msp/debt-collection.test.ts @@ -63,13 +63,14 @@ describeMspNet("Single MSP collecting debt", ({ before, createMsp1Api, it, creat // Load each file in storage and issue the storage requests const txs = []; for (let i = 0; i < source.length; i++) { - const { fingerprint, file_size, location } = - await userApi.rpc.storagehubclient.loadFileInStorage( - source[i], - destination[i], - userApi.shConsts.NODE_INFOS.user.AddressId, - bucketId - ); + const { + file_metadata: { location, fingerprint, file_size } + } = await userApi.rpc.storagehubclient.loadFileInStorage( + source[i], + destination[i], + userApi.shConsts.NODE_INFOS.user.AddressId, + bucketId + ); txs.push( userApi.tx.fileSystem.issueStorageRequest( diff --git a/test/suites/integration/msp/move-bucket.test.ts b/test/suites/integration/msp/move-bucket.test.ts index bd4f737a..a0661bd0 100644 --- a/test/suites/integration/msp/move-bucket.test.ts +++ b/test/suites/integration/msp/move-bucket.test.ts @@ -104,13 +104,14 @@ describeMspNet( // Seal block with 3 storage requests. const txs = []; for (let i = 0; i < source.length; i++) { - const { fingerprint, file_size, location } = - await userApi.rpc.storagehubclient.loadFileInStorage( - source[i], - destination[i], - userApi.shConsts.NODE_INFOS.user.AddressId, - bucketId - ); + const { + file_metadata: { location, fingerprint, file_size } + } = await userApi.rpc.storagehubclient.loadFileInStorage( + source[i], + destination[i], + userApi.shConsts.NODE_INFOS.user.AddressId, + bucketId + ); txs.push( userApi.tx.fileSystem.issueStorageRequest( diff --git a/test/suites/integration/msp/respond-multi-requests.test.ts b/test/suites/integration/msp/respond-multi-requests.test.ts index deecbe7a..d92b25d6 100644 --- a/test/suites/integration/msp/respond-multi-requests.test.ts +++ b/test/suites/integration/msp/respond-multi-requests.test.ts @@ -44,13 +44,14 @@ describeMspNet( // Seal block with 3 storage requests. const txs = []; for (let i = 0; i < source.length; i++) { - const { fingerprint, file_size, location } = - await userApi.rpc.storagehubclient.loadFileInStorage( - source[i], - destination[i], - userApi.shConsts.NODE_INFOS.user.AddressId, - bucketId - ); + const { + file_metadata: { location, fingerprint, file_size } + } = await userApi.rpc.storagehubclient.loadFileInStorage( + source[i], + destination[i], + userApi.shConsts.NODE_INFOS.user.AddressId, + bucketId + ); txs.push( userApi.tx.fileSystem.issueStorageRequest( diff --git a/test/suites/integration/msp/respond-single-request.test.ts b/test/suites/integration/msp/respond-single-request.test.ts index 00b1b22d..fe761ad7 100644 --- a/test/suites/integration/msp/respond-single-request.test.ts +++ b/test/suites/integration/msp/respond-single-request.test.ts @@ -34,13 +34,14 @@ describeMspNet( assert(newBucketEventDataBlob, "Event doesn't match Type"); - const { location, fingerprint, file_size } = - await userApi.rpc.storagehubclient.loadFileInStorage( - source, - destination, - userApi.shConsts.NODE_INFOS.user.AddressId, - newBucketEventDataBlob.bucketId - ); + const { + file_metadata: { location, fingerprint, file_size } + } = await userApi.rpc.storagehubclient.loadFileInStorage( + source, + destination, + userApi.shConsts.NODE_INFOS.user.AddressId, + newBucketEventDataBlob.bucketId + ); strictEqual(location.toHuman(), destination); strictEqual(fingerprint.toString(), userApi.shConsts.TEST_ARTEFACTS[source].fingerprint); diff --git a/test/suites/integration/user/file-upload-storage-request.test.ts b/test/suites/integration/user/file-upload-storage-request.test.ts index b9a30efc..ff91289f 100644 --- a/test/suites/integration/user/file-upload-storage-request.test.ts +++ b/test/suites/integration/user/file-upload-storage-request.test.ts @@ -49,13 +49,14 @@ describeBspNet("User: Issue Storage Requests", ({ before, createUserApi, it }) = throw new Error("Event doesn't match Type"); } - const { location, fingerprint, file_size } = - await userApi.rpc.storagehubclient.loadFileInStorage( - source, - destination, - userApi.shConsts.NODE_INFOS.user.AddressId, - newBucketEventDataBlob.bucketId - ); + const { + file_metadata: { location, fingerprint, file_size } + } = await userApi.rpc.storagehubclient.loadFileInStorage( + source, + destination, + userApi.shConsts.NODE_INFOS.user.AddressId, + newBucketEventDataBlob.bucketId + ); strictEqual(location.toHuman(), destination); strictEqual(fingerprint.toString(), userApi.shConsts.TEST_ARTEFACTS[source].fingerprint); diff --git a/test/suites/integration/user/load-file-storage.test.ts b/test/suites/integration/user/load-file-storage.test.ts index 9d778b05..b9988a85 100644 --- a/test/suites/integration/user/load-file-storage.test.ts +++ b/test/suites/integration/user/load-file-storage.test.ts @@ -21,13 +21,14 @@ describeBspNet("User: Load File Into Storage", ({ before, createUserApi, it }) = throw new Error("Event doesn't match Type"); } - const { location, fingerprint, file_size } = - await userApi.rpc.storagehubclient.loadFileInStorage( - source, - destination, - userApi.shConsts.NODE_INFOS.user.AddressId, - newBucketEventDataBlob.bucketId - ); + const { + file_metadata: { location, fingerprint, file_size } + } = await userApi.rpc.storagehubclient.loadFileInStorage( + source, + destination, + userApi.shConsts.NODE_INFOS.user.AddressId, + newBucketEventDataBlob.bucketId + ); strictEqual(location.toHuman(), destination); strictEqual(fingerprint.toString(), userApi.shConsts.TEST_ARTEFACTS[source].fingerprint); @@ -72,13 +73,14 @@ describeBspNet("User: Load File Into Storage", ({ before, createUserApi, it }) = throw new Error("Event doesn't match Type"); } - const { location, fingerprint, file_size } = - await userApi.rpc.storagehubclient.loadFileInStorage( - source, - destination, - userApi.shConsts.NODE_INFOS.user.AddressId, - newBucketEventDataBlob.bucketId - ); + const { + file_metadata: { location, fingerprint, file_size } + } = await userApi.rpc.storagehubclient.loadFileInStorage( + source, + destination, + userApi.shConsts.NODE_INFOS.user.AddressId, + newBucketEventDataBlob.bucketId + ); strictEqual(location.toHuman(), destination); strictEqual(fingerprint.toString(), userApi.shConsts.TEST_ARTEFACTS[source].fingerprint); @@ -98,13 +100,14 @@ describeBspNet("User: Load File Into Storage", ({ before, createUserApi, it }) = throw new Error("Event doesn't match Type"); } - const { location, fingerprint, file_size } = - await userApi.rpc.storagehubclient.loadFileInStorage( - source, - destination, - userApi.shConsts.NODE_INFOS.user.AddressId, - newBucketEventDataBlob.bucketId - ); + const { + file_metadata: { location, fingerprint, file_size } + } = await userApi.rpc.storagehubclient.loadFileInStorage( + source, + destination, + userApi.shConsts.NODE_INFOS.user.AddressId, + newBucketEventDataBlob.bucketId + ); strictEqual(location.toHuman(), destination); strictEqual(fingerprint.toString(), userApi.shConsts.TEST_ARTEFACTS[source].fingerprint);