Skip to content

Commit

Permalink
whale-api-client: query pagination chaining (#62)
Browse files Browse the repository at this point in the history
* added query pagination spec

* refactor call.call tp rpc.call
also fixed cherry pick errors

* fixed test

* updated sanity test
  • Loading branch information
fuxingloh authored May 12, 2021
1 parent 4041557 commit 4d885c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/whale/src/module.api/_module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { APP_PIPE } from '@nestjs/core'
import { Module } from '@nestjs/common'
import { CallController } from '@src/module.api/call.controller'
import { RpcController } from '@src/module.api/rpc.controller'
import { HealthController } from '@src/module.api/health.controller'
import { TransactionsController } from '@src/module.api/transactions.controller'
import { ApiValidationPipe } from '@src/module.api/_validation'
Expand All @@ -10,7 +10,7 @@ import { ApiValidationPipe } from '@src/module.api/_validation'
*/
@Module({
controllers: [
CallController,
RpcController,
HealthController,
TransactionsController
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Test, TestingModule } from '@nestjs/testing'
import { JsonRpcClient } from '@defichain/jellyfish-api-jsonrpc'
import { RegTestContainer } from '@defichain/testcontainers'
import { CallController } from '@src/module.api/call.controller'
import { RpcController } from '@src/module.api/rpc.controller'
import { ConfigModule } from '@nestjs/config'

const container = new RegTestContainer()
let client: JsonRpcClient
let controller: CallController
let controller: RpcController

beforeAll(async () => {
await container.start()
Expand All @@ -23,11 +23,11 @@ beforeEach(async () => {
imports: [ConfigModule.forRoot({
load: [() => ({ network: 'regtest' })]
})],
controllers: [CallController],
controllers: [RpcController],
providers: [{ provide: JsonRpcClient, useFactory: () => client }]
}).compile()

controller = app.get<CallController>(CallController)
controller = app.get<RpcController>(RpcController)
})

it('should getblockchaininfo', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ export class CallDto {
params?: any[]
}

@Controller('/v1/:network/call')
@Controller('/v1/:network/rpc')
@UseGuards(NetworkGuard)
@UseInterceptors(ResponseInterceptor, ExceptionInterceptor)
export class CallController {
export class RpcController {
constructor (private readonly client: JsonRpcClient) {
}

Expand Down

0 comments on commit 4d885c9

Please sign in to comment.