-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e605196
commit 5c5599c
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
apps/whale-api/src/module.api/__defid__/rpc.controller.defid.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { DRpcController, DefidBin } from '../../e2e.defid.module' | ||
|
||
let app: DefidBin | ||
let controller: DRpcController | ||
|
||
beforeAll(async () => { | ||
app = new DefidBin() | ||
await app.start() | ||
controller = app.ocean.rpcController | ||
await app.waitForWalletCoinbaseMaturity() | ||
await app.waitForWalletBalanceGTE(100) | ||
|
||
await app.waitForBlockHeight(100) | ||
}) | ||
|
||
afterAll(async () => { | ||
await app.stop() | ||
}) | ||
|
||
it('test whitelisted getblockcount rpc call', async () => { | ||
const res = await controller.post({ method: 'getblockcount', params: [] }) | ||
expect(res.data).toStrictEqual(101) | ||
}) | ||
|
||
it('test **NOT** whitelisted listpoolpairs rpc call', async () => { | ||
await expect( | ||
controller.post({ | ||
method: 'listpoolpairs', | ||
params: [{ start: 0, including_start: true, limit: 3 }, true] | ||
}) | ||
).rejects.toThrowError('403 - Unknown (/v0/regtest/rpc): Rpc listpoolpairs method is not whitelisted') | ||
}) |