Skip to content

Commit

Permalink
add new market query
Browse files Browse the repository at this point in the history
  • Loading branch information
quasisamurai committed May 16, 2024
1 parent ca17f47 commit 36b3aaa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@cosmos-client/core": "^0.47.4",
"@cosmos-client/cosmwasm": "^0.40.3",
"@cosmos-client/ibc": "^1.2.1",
"@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#eff816016c258331d489a074db3546aaa542fd04",
"@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#d4478cf2c0011754c036ffa3f30c90d000ab7b09",
"@types/lodash": "^4.14.182",
"@types/long": "^5.0.0",
"axios": "^0.27.2",
Expand Down
24 changes: 18 additions & 6 deletions src/testcases/run_in_band/slinky.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
import {
ParamsResponse,
LastUpdatedResponse,
MarketMapResponse,
MarketMapResponse, MarketResponse,

Check failure on line 23 in src/testcases/run_in_band/slinky.test.ts

View workflow job for this annotation

GitHub Actions / Actions - lint

'MarketMapResponse' is defined but never used

Check failure on line 23 in src/testcases/run_in_band/slinky.test.ts

View workflow job for this annotation

GitHub Actions / Actions - lint

Insert `⏎·`
} from '@neutron-org/neutronjsplus/src/marketmap';

const config = require('../../config.json');
Expand Down Expand Up @@ -214,15 +214,27 @@ describe('Neutron / Slinky', () => {
});

test('query market', async () => {
const res = await neutronChain.queryContract<MarketMapResponse>(
const res = await neutronChain.queryContract<MarketResponse>(
contractAddress,
{
market_map: {},
currency_pair: { Base: 'ETH', Quote: 'USDT'},

Check failure on line 220 in src/testcases/run_in_band/slinky.test.ts

View workflow job for this annotation

GitHub Actions / Actions - lint

Insert `·`
},
);
expect(res.market_map).toBeDefined();
expect(res.last_updated).toBeDefined();
expect(res.chain_id).toBeDefined();
expect(res.market).toBeDefined();
});

test('query market', async () => {
const res = await neutronChain.queryContract<ParamsResponse>(
contractAddress,
{
params: {},
},
);
expect(res).toBeDefined();
expect(res.params.version).toEqual(0);
expect(res.params.market_authorities[0]).toEqual(
'neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z',
);
});

test('query params', async () => {
Expand Down

0 comments on commit 36b3aaa

Please sign in to comment.