From dfb46d8185c684a18452e1325abcf74d59c48159 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Fri, 3 Nov 2023 10:36:24 +0100 Subject: [PATCH] fix: receipt chain has wrong CID because no expiration is set (#1060) --- packages/filecoin-api/src/aggregator/service.js | 1 + packages/filecoin-api/test/services/aggregator.js | 2 ++ packages/filecoin-client/src/aggregator.js | 2 ++ packages/filecoin-client/src/dealer.js | 2 ++ packages/filecoin-client/src/storefront.js | 3 +++ packages/filecoin-client/test/aggregator.test.js | 1 + packages/filecoin-client/test/dealer.test.js | 1 + packages/filecoin-client/test/storefront.test.js | 2 ++ 8 files changed, 14 insertions(+) diff --git a/packages/filecoin-api/src/aggregator/service.js b/packages/filecoin-api/src/aggregator/service.js index b808251c3..b1e4d08d0 100644 --- a/packages/filecoin-api/src/aggregator/service.js +++ b/packages/filecoin-api/src/aggregator/service.js @@ -96,6 +96,7 @@ export const pieceAccept = async ({ capability }, context) => { aggregate, pieces, }, + expiration: Infinity, }) .delegate() diff --git a/packages/filecoin-api/test/services/aggregator.js b/packages/filecoin-api/test/services/aggregator.js index 61432e077..f8695f794 100644 --- a/packages/filecoin-api/test/services/aggregator.js +++ b/packages/filecoin-api/test/services/aggregator.js @@ -274,6 +274,7 @@ export const test = { piece, group, }, + expiration: Infinity }) const response = await pieceAcceptInv.execute(connection) @@ -305,6 +306,7 @@ export const test = { aggregate: aggregate.link, pieces: piecesBlock.cid, }, + expiration: Infinity }) .delegate() assert.ok(response.fx.join) diff --git a/packages/filecoin-client/src/aggregator.js b/packages/filecoin-client/src/aggregator.js index d702dddf3..5691d8299 100644 --- a/packages/filecoin-client/src/aggregator.js +++ b/packages/filecoin-client/src/aggregator.js @@ -56,6 +56,7 @@ export async function pieceOffer( group, }, proofs, + expiration: Infinity, }) return await invocation.execute(conn) @@ -101,6 +102,7 @@ export async function pieceAccept( group, }, proofs, + expiration: Infinity, }) return await invocation.execute(conn) diff --git a/packages/filecoin-client/src/dealer.js b/packages/filecoin-client/src/dealer.js index 1c6919a8c..3eaa8a7b4 100644 --- a/packages/filecoin-client/src/dealer.js +++ b/packages/filecoin-client/src/dealer.js @@ -58,6 +58,7 @@ export async function aggregateOffer( pieces: block.cid, }, proofs, + expiration: Infinity, }) invocation.attach(block) @@ -103,6 +104,7 @@ export async function aggregateAccept( pieces, }, proofs, + expiration: Infinity, }) return await invocation.execute(conn) diff --git a/packages/filecoin-client/src/storefront.js b/packages/filecoin-client/src/storefront.js index 7eed402d8..917f11b2a 100644 --- a/packages/filecoin-client/src/storefront.js +++ b/packages/filecoin-client/src/storefront.js @@ -54,6 +54,7 @@ export async function filecoinOffer( piece, }, proofs, + expiration: Infinity, }) return await invocation.execute(conn) @@ -97,6 +98,7 @@ export async function filecoinSubmit( piece, }, proofs, + expiration: Infinity, }) return await invocation.execute(conn) @@ -140,6 +142,7 @@ export async function filecoinAccept( piece, }, proofs, + expiration: Infinity, }) return await invocation.execute(conn) diff --git a/packages/filecoin-client/test/aggregator.test.js b/packages/filecoin-client/test/aggregator.test.js index c76c31097..11dbbbde8 100644 --- a/packages/filecoin-client/test/aggregator.test.js +++ b/packages/filecoin-client/test/aggregator.test.js @@ -48,6 +48,7 @@ describe('aggregator', () => { nb: { ...invCap.nb, }, + expiration: Infinity, }) .delegate() diff --git a/packages/filecoin-client/test/dealer.test.js b/packages/filecoin-client/test/dealer.test.js index dc809fdfa..415b0665d 100644 --- a/packages/filecoin-client/test/dealer.test.js +++ b/packages/filecoin-client/test/dealer.test.js @@ -52,6 +52,7 @@ describe('dealer', () => { audience: context.id, with: context.id.did(), nb: invCap.nb, + expiration: Infinity, }) .delegate() diff --git a/packages/filecoin-client/test/storefront.test.js b/packages/filecoin-client/test/storefront.test.js index 0fdcdabf9..acb00d235 100644 --- a/packages/filecoin-client/test/storefront.test.js +++ b/packages/filecoin-client/test/storefront.test.js @@ -49,6 +49,7 @@ describe('storefront', () => { audience: context.id, with: context.id.did(), nb: invCap.nb, + expiration: Infinity, }) .delegate() @@ -58,6 +59,7 @@ describe('storefront', () => { audience: context.id, with: context.id.did(), nb: invCap.nb, + expiration: Infinity, }) .delegate()