diff --git a/src/provider/provider-sessions.spec.ts b/src/provider/provider-sessions.spec.ts index 6cf2911..3a592b4 100644 --- a/src/provider/provider-sessions.spec.ts +++ b/src/provider/provider-sessions.spec.ts @@ -23,7 +23,14 @@ import { ProviderSessions } from './provider-sessions' class ProviderServiceTequilapiClientMock extends EmptyTequilapiClientMock { public serviceSessionsMock: ServiceSession[] = [ - { id: 'id1', consumerId: '0x1', createdAt: '2019-01-01', bytesIn: 10, bytesOut: 11 }, + { + id: 'id1', + consumerId: '0x1', + createdAt: '2019-01-01', + bytesIn: 10, + bytesOut: 11, + tokensEarned: 1000, + }, ] public async serviceSessions(): Promise { diff --git a/src/provider/service-session.spec.ts b/src/provider/service-session.spec.ts index 0ba0860..8dafe9f 100644 --- a/src/provider/service-session.spec.ts +++ b/src/provider/service-session.spec.ts @@ -24,6 +24,7 @@ describe('TequilapiClient DTO', () => { createdAt: '2019-01-01', bytesIn: 10, bytesOut: 11, + tokensEarned: 4_000, } describe('.parseServiceInfo', () => { diff --git a/src/provider/service-session.ts b/src/provider/service-session.ts index 351f574..bf42a2b 100644 --- a/src/provider/service-session.ts +++ b/src/provider/service-session.ts @@ -23,6 +23,7 @@ export interface ServiceSession { createdAt: string bytesIn: number bytesOut: number + tokensEarned: number } export function parseServiceSession(data: any): ServiceSession { @@ -32,6 +33,7 @@ export function parseServiceSession(data: any): ServiceSession { { name: 'createdAt', type: 'string' }, { name: 'bytesIn', type: 'number' }, { name: 'bytesOut', type: 'number' }, + { name: 'tokensEarned', type: 'number' }, ]) return data } diff --git a/src/tequilapi-client.spec.ts b/src/tequilapi-client.spec.ts index 6043624..e469853 100644 --- a/src/tequilapi-client.spec.ts +++ b/src/tequilapi-client.spec.ts @@ -722,6 +722,7 @@ describe('HttpTequilapiClient', () => { createdAt: '2019-01-01 00:00:00', bytesIn: 1000, bytesOut: 100, + tokensEarned: 1000, }, { id: '76fca3dc-28d0-4f00-b06e-a7d6050699ae', @@ -729,6 +730,7 @@ describe('HttpTequilapiClient', () => { createdAt: '2019-01-02 00:00:00', bytesIn: 1100, bytesOut: 101, + tokensEarned: 1000, }, ], }