Skip to content

Commit 650db3c

Browse files
committed
chore: remove force_optimize_code_size in protobuf bundle
1 parent 1087414 commit 650db3c

File tree

23 files changed

+3276
-9008
lines changed

23 files changed

+3276
-9008
lines changed

package.json

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
"build": "node etc/bootstrapEnv && lerna run build",
1212
"type-check": "tsc --noEmit",
1313
"build:check": "pnpm type-check && pnpm build",
14-
"generate:core-proto-ts": "./protoV2/core/gen.sh",
15-
"publish:core-proto-ts": "./protoV2/core/publish.sh",
16-
"generate:indexer-proto-ts": "./protoV2/indexer/gen.sh",
17-
"publish:indexer-proto-ts": "./protoV2/indexer/publish.sh",
1814
"generate:mito-proto-ts": "./protoV2/mito/gen.sh",
1915
"publish:mito-proto-ts": "./protoV2/mito/publish.sh",
2016
"generate:olp-proto-ts": "./protoV2/olp/gen.sh",
2117
"publish:olp-proto-ts": "./protoV2/olp/publish.sh",
18+
"generate:core-proto-ts": "./protoV2/core/gen.sh",
19+
"publish:core-proto-ts": "./protoV2/core/publish.sh",
2220
"generate:abacus-proto-ts": "./protoV2/abacus/gen.sh",
2321
"publish:abacus-proto-ts": "./protoV2/abacus/publish.sh",
22+
"generate:indexer-proto-ts": "./protoV2/indexer/gen.sh",
23+
"publish:indexer-proto-ts": "./protoV2/indexer/publish.sh",
2424
"release:patch": "pnpm build:fresh && lerna version patch --conventional-commits --force-git-tag --yes && pnpm publish -r --access public --tag latest --no-git-checks",
2525
"release:minor": "pnpm build:fresh && lerna version minor --conventional-commits --force-git-tag --yes && pnpm publish -r --access public --tag latest --no-git-checks",
2626
"build:watch": "node etc/bootstrapEnv && lerna run build:watch --parallel --stream",
@@ -29,16 +29,10 @@
2929
"clean-up": "lerna run clean && nx reset && shx rm -rf .build-cache *.log coverage junit.xml",
3030
"cache:clear": "nx reset",
3131
"bootstrap": "pnpm clean-up && pnpm install",
32-
"test": "vitest run",
33-
"test:coverage": "vitest run --coverage",
34-
"test:sdk-ts:core:stargate": "vitest run ./packages/sdk-ts/src/core/stargate",
35-
"test:sdk-ts:core:modules": "vitest run ./packages/sdk-ts/src/core/modules",
36-
"test:sdk-ts:core:account": "vitest run ./packages/sdk-ts/src/core/account",
37-
"test:sdk-ts:core": "vitest run ./packages/sdk-ts/src/core",
38-
"test:sdk-ts:utils": "vitest run ./packages/sdk-ts/src/utils",
39-
"test:sdk-ts:client": "vitest run ./packages/sdk-ts/src/client",
40-
"test:ci": "vitest run --coverage --reporter=verbose",
41-
"coverage:show": "live-server coverage",
32+
"test:watch": "vitest",
33+
"test": "npm run test:standard; npm run test:broadcast",
34+
"test:standard": "vitest run",
35+
"test:broadcast": "vitest run --config=vitest.broadcast.config.ts",
4236
"lint": "cross-env NODE_OPTIONS='--max-old-space-size=4096' lerna run lint",
4337
"lint:fix": "cross-env NODE_OPTIONS='--max-old-space-size=4096' lerna run lint -- --fix",
4438
"husky-skip": "cross-env HUSKY_SKIP_HOOKS=1",

packages/sdk-ts/package.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -322,16 +322,16 @@
322322
"@cosmjs/amino": "catalog:",
323323
"@cosmjs/proto-signing": "catalog:",
324324
"@cosmjs/stargate": "catalog:",
325-
"@injectivelabs/abacus-proto-ts-v2": "1.17.3",
326-
"@injectivelabs/core-proto-ts-v2": "1.17.2",
327-
"@injectivelabs/exceptions": "workspace:*",
328-
"@injectivelabs/grpc-web": "^0.0.1",
329325
"@injectivelabs/grpc-web-node-http-transport": "^0.0.2",
330326
"@injectivelabs/grpc-web-react-native-transport": "^0.0.2",
331-
"@injectivelabs/indexer-proto-ts-v2": "1.17.4",
332-
"@injectivelabs/mito-proto-ts-v2": "1.17.2",
327+
"@injectivelabs/exceptions": "workspace:*",
328+
"@injectivelabs/grpc-web": "^0.0.1",
329+
"@injectivelabs/olp-proto-ts-v2": "1.17.3",
330+
"@injectivelabs/core-proto-ts-v2": "1.17.3",
331+
"@injectivelabs/mito-proto-ts-v2": "1.17.3",
332+
"@injectivelabs/abacus-proto-ts-v2": "1.17.4",
333+
"@injectivelabs/indexer-proto-ts-v2": "1.17.5",
333334
"@injectivelabs/networks": "workspace:*",
334-
"@injectivelabs/olp-proto-ts-v2": "1.17.2",
335335
"@injectivelabs/ts-types": "workspace:*",
336336
"@injectivelabs/utils": "workspace:*",
337337
"@noble/curves": "catalog:",
@@ -349,9 +349,6 @@
349349
"snakecase-keys": "^5.4.1",
350350
"viem": "catalog:"
351351
},
352-
"devDependencies": {
353-
"shx": "^0.3.4"
354-
},
355352
"publishConfig": {
356353
"access": "public"
357354
},

packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcDerivativesApi.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ describe('IndexerGrpcDerivativeApi', () => {
312312
(e as any).message,
313313
)
314314
}
315-
})
315+
}, 60000)
316316

317317
test('fetchPositions', async () => {
318318
try {

packages/sdk-ts/src/client/indexer/grpc_stream/IndexerGrpcDerivativesStream.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ describe('IndexerGrpcDerivativesStream', () => {
100100
})
101101
})
102102

103-
describe('streamDerivativeOrderbookV2', () => {
103+
describe('streamOrderbooksV2', () => {
104104
it('should create subscription with unsubscribe method', () => {
105-
const subscription = derivativesStream.streamDerivativeOrderbookV2({
105+
const subscription = derivativesStream.streamOrderbooksV2({
106106
marketIds: [mockMarketId],
107107
callback: () => {},
108108
})
@@ -114,9 +114,9 @@ describe('IndexerGrpcDerivativesStream', () => {
114114
})
115115
})
116116

117-
describe('streamDerivativeOrders', () => {
117+
describe('streamOrders', () => {
118118
it('should create subscription with unsubscribe method', () => {
119-
const subscription = derivativesStream.streamDerivativeOrders({
119+
const subscription = derivativesStream.streamOrders({
120120
marketId: mockMarketId,
121121
callback: () => {},
122122
})
@@ -128,9 +128,9 @@ describe('IndexerGrpcDerivativesStream', () => {
128128
})
129129
})
130130

131-
describe('streamDerivativeTrades', () => {
131+
describe('streamTrades', () => {
132132
it('should create subscription with unsubscribe method', () => {
133-
const subscription = derivativesStream.streamDerivativeTrades({
133+
const subscription = derivativesStream.streamTrades({
134134
marketId: mockMarketId,
135135
callback: () => {},
136136
})

packages/sdk-ts/src/client/indexer/grpc_stream/IndexerGrpcMitoStream.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import { mockFactory } from '@injectivelabs/utils/test-utils'
12
import { Network, getNetworkEndpoints } from '@injectivelabs/networks'
23
import { IndexerGrpcMitoStream } from './IndexerGrpcMitoStream.js'
34

45
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
6+
const injectiveAddress = mockFactory.injectiveAddress
7+
const stakingContractAddress = 'inj1pxzykc8qry3ytxwxr3ua72tn6e4wvusj40yy2w'
58

69
describe('IndexerGrpcMitoStream', () => {
710
let mitoStream: IndexerGrpcMitoStream
@@ -62,6 +65,7 @@ describe('IndexerGrpcMitoStream', () => {
6265
describe('streamVaultHolderSubscriptions', () => {
6366
it('should create subscription with unsubscribe method', () => {
6467
const subscription = mitoStream.streamVaultHolderSubscriptions({
68+
holderAddress: injectiveAddress,
6569
callback: () => {},
6670
})
6771

@@ -75,6 +79,8 @@ describe('IndexerGrpcMitoStream', () => {
7579
describe('streamStakingRewardsByAccount', () => {
7680
it('should create subscription with unsubscribe method', () => {
7781
const subscription = mitoStream.streamStakingRewardsByAccount({
82+
staker: injectiveAddress,
83+
stakingContractAddress: stakingContractAddress,
7884
callback: () => {},
7985
})
8086

@@ -88,6 +94,8 @@ describe('IndexerGrpcMitoStream', () => {
8894
describe('streamHistoricalStaking', () => {
8995
it('should create subscription with unsubscribe method', () => {
9096
const subscription = mitoStream.streamHistoricalStaking({
97+
staker: injectiveAddress,
98+
stakingContractAddress: stakingContractAddress,
9199
callback: () => {},
92100
})
93101

packages/sdk-ts/src/client/indexer/grpc_stream/IndexerGrpcSpotStream.spec.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ describe('IndexerGrpcSpotStream', () => {
2727
})
2828
})
2929

30-
describe('streamSpotMarket', () => {
30+
describe('streamMarkets', () => {
3131
it('should create subscription with unsubscribe method', () => {
32-
const subscription = spotStream.streamSpotMarket({
32+
const subscription = spotStream.streamMarkets({
3333
callback: () => {},
3434
})
3535

@@ -41,7 +41,7 @@ describe('IndexerGrpcSpotStream', () => {
4141

4242
it('should throw error if callback is not a function', () => {
4343
expect(() => {
44-
spotStream.streamSpotMarket({
44+
spotStream.streamMarkets({
4545
callback: null as any,
4646
})
4747
}).toThrow('callback must be a function')
@@ -50,7 +50,7 @@ describe('IndexerGrpcSpotStream', () => {
5050
it('should stop receiving callbacks after unsubscribe', async () => {
5151
let callbackCount = 0
5252

53-
const subscription = spotStream.streamSpotMarket({
53+
const subscription = spotStream.streamMarkets({
5454
callback: () => {
5555
callbackCount++
5656
},
@@ -66,9 +66,9 @@ describe('IndexerGrpcSpotStream', () => {
6666
})
6767
})
6868

69-
describe('streamSpotOrderbookV2', () => {
69+
describe('streamOrderbooksV2', () => {
7070
it('should create subscription with unsubscribe method', () => {
71-
const subscription = spotStream.streamSpotOrderbookV2({
71+
const subscription = spotStream.streamOrderbooksV2({
7272
marketIds: [mockMarketId],
7373
callback: () => {},
7474
})
@@ -81,7 +81,7 @@ describe('IndexerGrpcSpotStream', () => {
8181

8282
it('should throw error if callback is not a function', () => {
8383
expect(() => {
84-
spotStream.streamSpotOrderbookV2({
84+
spotStream.streamOrderbooksV2({
8585
marketIds: [mockMarketId],
8686
callback: null as any,
8787
})
@@ -91,7 +91,7 @@ describe('IndexerGrpcSpotStream', () => {
9191
it('should handle orderbook stream cancellation', async () => {
9292
let callbackCount = 0
9393

94-
const subscription = spotStream.streamSpotOrderbookV2({
94+
const subscription = spotStream.streamOrderbooksV2({
9595
marketIds: [mockMarketId],
9696
callback: () => {
9797
callbackCount++
@@ -108,9 +108,9 @@ describe('IndexerGrpcSpotStream', () => {
108108
})
109109
})
110110

111-
describe('streamSpotOrderbookUpdate', () => {
111+
describe('streamOrderbookUpdates', () => {
112112
it('should create subscription with unsubscribe method', () => {
113-
const subscription = spotStream.streamSpotOrderbookUpdate({
113+
const subscription = spotStream.streamOrderbookUpdates({
114114
marketIds: [mockMarketId],
115115
callback: () => {},
116116
})
@@ -122,9 +122,9 @@ describe('IndexerGrpcSpotStream', () => {
122122
})
123123
})
124124

125-
describe('streamSpotOrders', () => {
125+
describe('streamOrders', () => {
126126
it('should create subscription with unsubscribe method', () => {
127-
const subscription = spotStream.streamSpotOrders({
127+
const subscription = spotStream.streamOrders({
128128
marketId: mockMarketId,
129129
callback: () => {},
130130
})
@@ -136,9 +136,9 @@ describe('IndexerGrpcSpotStream', () => {
136136
})
137137
})
138138

139-
describe('streamSpotTrades', () => {
139+
describe('streamTrades', () => {
140140
it('should create subscription with unsubscribe method', () => {
141-
const subscription = spotStream.streamSpotTrades({
141+
const subscription = spotStream.streamTrades({
142142
marketId: mockMarketId,
143143
callback: () => {},
144144
})

packages/sdk-ts/src/client/indexer/grpc_stream/IndexerGrpcSpotStream.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,14 @@ export class IndexerGrpcSpotStream {
6161
this.client = new InjectiveSpotExchangeRPCClient(this.transport)
6262
}
6363

64-
/** @deprecated - use streamSpotOrderbookV2 */
65-
streamSpotOrderbook(_args: {
64+
/** @deprecated - use streamOrderbookV2 */
65+
streamOrderbook(_args: {
6666
marketIds: string[]
6767
callback: any
6868
onEndCallback?: (status?: StreamStatusResponse) => void
6969
onStatusCallback?: (status: StreamStatusResponse) => void
7070
}): Subscription {
71-
throw new GeneralException(
72-
new Error('deprecated - use streamDerivativeOrderbookV2'),
73-
)
71+
throw new GeneralException(new Error('deprecated - use streamOrderbookV2'))
7472
}
7573

7674
/**
@@ -84,7 +82,7 @@ export class IndexerGrpcSpotStream {
8482
* @param params.onStatusCallback - Called on stream errors
8583
* @returns Subscription object with unsubscribe method
8684
*/
87-
streamSpotOrders({
85+
streamOrders({
8886
marketId,
8987
subaccountId,
9088
orderSide,
@@ -144,7 +142,7 @@ export class IndexerGrpcSpotStream {
144142
* @param params.onStatusCallback - Called on stream errors
145143
* @returns Subscription object with unsubscribe method
146144
*/
147-
streamSpotOrderHistory({
145+
streamOrderHistory({
148146
marketId,
149147
subaccountId,
150148
orderTypes,
@@ -226,7 +224,7 @@ export class IndexerGrpcSpotStream {
226224
* @param params.onStatusCallback - Called on stream errors
227225
* @returns Subscription object with unsubscribe method
228226
*/
229-
streamSpotTrades({
227+
streamTrades({
230228
marketIds,
231229
marketId,
232230
subaccountIds,
@@ -311,7 +309,7 @@ export class IndexerGrpcSpotStream {
311309
* @param params.onStatusCallback - Called on stream errors
312310
* @returns Subscription object with unsubscribe method
313311
*/
314-
streamSpotMarket({
312+
streamMarkets({
315313
marketIds,
316314
callback,
317315
onEndCallback,
@@ -354,7 +352,7 @@ export class IndexerGrpcSpotStream {
354352
* @param params.onStatusCallback - Called on stream errors
355353
* @returns Subscription object with unsubscribe method
356354
*/
357-
streamSpotOrderbookV2({
355+
streamOrderbooksV2({
358356
marketIds,
359357
callback,
360358
onEndCallback,
@@ -400,7 +398,7 @@ export class IndexerGrpcSpotStream {
400398
* @param params.onStatusCallback - Called on stream errors
401399
* @returns Subscription object with unsubscribe method
402400
*/
403-
streamSpotOrderbookUpdate({
401+
streamOrderbookUpdates({
404402
marketIds,
405403
callback,
406404
onEndCallback,

packages/sdk-ts/src/core/stargate/SigninStargateClient.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { InjectiveDirectEthSecp256k1Wallet } from '../accounts/signers/index.js'
66
import type { OfflineSigner } from '@cosmjs/proto-signing'
77
import type { InjectiveOfflineSigner } from '../accounts/signers/types/index.js'
88

9-
describe('SigningStargateClient', () => {
9+
describe.sequential('SigningStargateClient', () => {
1010
it('can sign and broadcast a transaction', async () => {
1111
const privateKey = PrivateKey.fromHex(
1212
process.env.TEST_PRIVATE_KEY as string,

packages/wallets/wallet-core/src/broadcaster/MsgBroadcaster.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const broadcasterArgs: MsgBroadcasterOptions = {
3535
}
3636
export const msgBroadcaster = new MsgBroadcaster(broadcasterArgs)
3737

38-
describe('MsgBroadcaster', () => {
38+
describe.sequential('MsgBroadcaster', () => {
3939
test('prepares, simulates, signs and broadcasts a transaction', async () => {
4040
const privateKey = PrivateKey.fromHex(
4141
process.env.TEST_PRIVATE_KEY as string,

packages/wallets/wallet-private-key/src/strategy/strategy.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const broadcasterArgs: MsgBroadcasterOptions = {
3535
}
3636
const msgBroadcaster = new MsgBroadcaster(broadcasterArgs)
3737

38-
describe('MsgBroadcaster', () => {
38+
describe.sequential('MsgBroadcaster', () => {
3939
test('prepares, simulates, signs and broadcasts a transaction', async () => {
4040
const pk = PrivateKey.fromHex(process.env.TEST_PRIVATE_KEY as string)
4141
const injectiveAddress = pk.toBech32()

0 commit comments

Comments
 (0)