Skip to content

Commit

Permalink
feat: adapt to new getPeriodByBlockHeight API (#171)
Browse files Browse the repository at this point in the history
BREAKING CHANGE
  • Loading branch information
troggy authored Feb 6, 2020
1 parent fcea469 commit b8b28ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
},
};

Expand Down

0 comments on commit b8b28ad

Please sign in to comment.