diff --git a/lib/helpers.js b/lib/helpers.js index 233428c..a6807d3 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -219,9 +219,9 @@ export function getYoungestInputTx(plasma, tx) { export function getProof(plasma, tx, periodOpts = {}) { return plasma.getPeriodByBlockHeight(tx.blockNumber) .then(periodData => { - if (periodData && periodData.length) { + if (periodData) { Object.assign(periodOpts, { - validatorData: periodData[0], + validatorData: periodData, }); } else { const msg = `No period data for the given tx. Height: ${tx.blockNumber}`; diff --git a/lib/helpers.spec.js b/lib/helpers.spec.js index 9492b2a..22db3b3 100644 --- a/lib/helpers.spec.js +++ b/lib/helpers.spec.js @@ -243,7 +243,7 @@ describe('helpers', () => { }, getPeriodByBlockHeight: n => { expect(n).to.be.equal(4); - return Promise.resolve([{ slotId: 0, validatorAddress: ADDR_1, casBitmap }]); + return Promise.resolve({ slotId: 0, validatorAddress: ADDR_1, casBitmap }); }, };