Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
status as enum
Browse files Browse the repository at this point in the history
  • Loading branch information
ayazzz committed Sep 19, 2022
1 parent b15b9b7 commit d023cbe
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mean-dao/msp",
"version": "3.0.0-alpha.19",
"version": "3.0.0-alpha.20",
"description": "MSP Typescript SDK",
"private": false,
"main": "lib/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ const parseGetStreamData = (
withdrawableAmount: event.beneficiaryWithdrawableAmount,
streamUnitsPerSecond: getStreamUnitsPerSecond(event),
isManuallyPaused: event.isManualPause,
status: event.status,
status: STREAM_STATUS[event.status],
lastRetrievedBlockTime: event.currentBlockTime.toNumber(),
lastRetrievedTimeInSeconds: parseInt((Date.now() / 1_000).toString()),
feePayedByTreasurer: event.feePayedByTreasurer,
Expand Down
16 changes: 15 additions & 1 deletion tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,21 @@ describe('MSP Tests\n', async () => {

});

it('BN & Bignumber', async () => {
it('Enum casting', () => {
const scheduled = 'Scheduled';
const scheduledEnum = STREAM_STATUS[scheduled];
console.log(scheduled, scheduledEnum);

const running = 'Running';
const runningEnum = STREAM_STATUS[running];
console.log(running, runningEnum);

const paused = 'Paused';
const pausedEnum = STREAM_STATUS[paused];
console.log(paused, pausedEnum);
});

xit('BN & Bignumber', async () => {
const strmId = new PublicKey('7uGiMnnnJdr28DPsCioeKLSF5uJjWP3wxYFGVmK3SEJh');
const stream = await msp.getStreamRaw(strmId);

Expand Down

0 comments on commit d023cbe

Please sign in to comment.