Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bangjelkoski committed Jun 17, 2024
1 parent 5d0b9d1 commit d5848ad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ module.exports = {
testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)'],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: ['/node_modules/'],
testPathIgnorePatterns: ['/node_modules/', '/deprecated/'],

// The regexp pattern or array of patterns that Jest uses to detect test files
// testRegex: [],
Expand Down
8 changes: 4 additions & 4 deletions packages/sdk-ts/src/client/chain/grpc/ChainGrpcIbcApi.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
import { ChainGrpcIbcApi } from './ChainGrpcIbcApi'
import { sha256 } from '../../../utils/crypto'
import { fromUtf8 } from '../../../utils/utf8'
import { IbcApplicationsTransferV1Transfer } from '@injectivelabs/core-proto-ts'
import { IbcApplicationsTransferV2Token } from '@injectivelabs/core-proto-ts'

const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcIbcApi = new ChainGrpcIbcApi(endpoints.grpc)
Expand All @@ -17,7 +17,7 @@ describe('ChainGrpcIbcApi', () => {

expect(response).toBeDefined()
expect(response).toEqual(
expect.objectContaining<IbcApplicationsTransferV1Transfer.DenomTrace[]>(
expect.objectContaining<IbcApplicationsTransferV2Token.Denom[]>(
response,
),
)
Expand All @@ -30,13 +30,13 @@ describe('ChainGrpcIbcApi', () => {
try {
const [trace] = await chainGrpcIbcApi.fetchDenomsTrace()
const ibcHash = Buffer.from(
sha256(fromUtf8(`${trace.path}/${trace.baseDenom}`)),
sha256(fromUtf8(`${trace.trace}/${trace.base}`)),
).toString('hex')
const response = await chainGrpcIbcApi.fetchDenomTrace(ibcHash)

expect(response).toBeDefined()
expect(response).toEqual(
expect.objectContaining<IbcApplicationsTransferV1Transfer.DenomTrace>(
expect.objectContaining<IbcApplicationsTransferV2Token.Denom>(
response,
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const params: MsgInstantSpotMarketLaunch['params'] = {
baseDenom: market.baseDenom,
quoteDenom: market.quoteDenom,
minPriceTickSize: market.minPriceTickSize,
minNotional: '1',
minQuantityTickSize: market.minQuantityTickSize,
},
}
Expand Down Expand Up @@ -66,6 +67,7 @@ describe('MsgInstantSpotMarketLaunch', () => {
{ name: 'quote_denom', type: 'string' },
{ name: 'min_price_tick_size', type: 'string' },
{ name: 'min_quantity_tick_size', type: 'string' },
{ name: 'min_notional', type: 'string' },
],
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export declare namespace MsgInstantSpotMarketLaunch {
ticker: string
baseDenom: string
quoteDenom: string
minNotional: string
minPriceTickSize: string
minQuantityTickSize: string
}
Expand All @@ -28,6 +29,7 @@ const createMessage = (params: MsgInstantSpotMarketLaunch.Params) => {
message.baseDenom = params.market.baseDenom
message.minPriceTickSize = params.market.minPriceTickSize
message.minQuantityTickSize = params.market.minQuantityTickSize
message.minNotional = params.market.minNotional

return InjectiveExchangeV1Beta1Tx.MsgInstantSpotMarketLaunch.fromPartial(
message,
Expand Down

0 comments on commit d5848ad

Please sign in to comment.