Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove bindings #ntrn-410 #362

Merged
merged 10 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"test": "yarn test:parallel && yarn test:run_in_band",
"test:parallel": "vitest --run src/testcases/parallel --bail 1 --reporter=basic",
"test:run_in_band": "yarn test:feemarket && yarn test:globalfee && yarn test:interchaintx && yarn test:interchain_kv_query && yarn test:interchain_tx_query_plain && yarn test:tokenomics && yarn test:reserve && yarn test:ibc_hooks && yarn test:float && yarn test:parameters && yarn test:slinky && yarn test:chain_manager && yarn test:tokenfactory && yarn test:cron && yarn test:dex_grpc && yarn test:dex_bindings",
"test:run_in_band": "yarn test:feemarket && yarn test:globalfee && yarn test:interchaintx && yarn test:interchain_kv_query && yarn test:interchain_tx_query_plain && yarn test:tokenomics && yarn test:reserve && yarn test:ibc_hooks && yarn test:float && yarn test:parameters && yarn test:slinky && yarn test:chain_manager && yarn test:tokenfactory && yarn test:cron && yarn test:dex_grpc",
"test:ibc_transfer": "vitest --run src/testcases/parallel/ibc_transfer --bail 1",
"test:slinky": "vitest --run src/testcases/run_in_band/slinky --bail 1",
"test:cron": "vitest --run src/testcases/run_in_band/cron --bail 1",
Expand All @@ -28,7 +28,6 @@
"test:voting_registry": "vitest --run src/testcases/parallel/voting_registry --bail 1",
"test:float": "NO_WAIT_CHANNEL1=1 NO_WAIT_HTTP2=1 NO_WAIT_CHANNEL2=1 NO_WAIT_DELAY=1 vitest --run src/testcases/run_in_band/float --bail 1",
"test:dex_grpc": "NO_WAIT_CHANNEL1=1 NO_WAIT_HTTP2=1 NO_WAIT_CHANNEL2=1 NO_WAIT_DELAY=1 vitest --run src/testcases/run_in_band/dex_grpc --bail 1",
"test:dex_bindings": "NO_WAIT_CHANNEL1=1 NO_WAIT_HTTP2=1 NO_WAIT_CHANNEL2=1 NO_WAIT_DELAY=1 vitest --run src/testcases/run_in_band/dex_bindings --bail 1",
"test:chain_manager": "vitest --run src/testcases/run_in_band/chain_manager --bail 1",
"test:feemarket": "NO_WAIT_CHANNEL1=1 NO_WAIT_HTTP2=1 NO_WAIT_CHANNEL2=1 NO_WAIT_DELAY=1 vitest --run src/testcases/run_in_band/feemarket --bail 1",
"test:ibc_rate_limit": "vitest --run src/testcases/run_in_band/ibc_rate_limit --bail 1",
Expand Down
1 change: 0 additions & 1 deletion src/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export const CONTRACTS = {
// https://github.com/CosmWasm/cosmwasm/tree/main/contracts/floaty
FLOATY: '../contracts_thirdparty/floaty_2.0.wasm',
DEX_GRPC: 'dex_grpc.wasm',
DEX_DEV: 'dex.wasm',
CRON: 'cron.wasm',

// TGE liquidity migration related contracts with fixed versions
Expand Down
42 changes: 20 additions & 22 deletions src/helpers/interchainqueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,26 +511,24 @@ export const getRegisteredQuery = async (
contractAddress: string,
queryId: number,
): Promise<{
registered_query: {
id: number;
owner: string;
keys: {
path: string;
key: string;
}[];
query_type: string;
transactions_filter: string;
connection_id: string;
update_period: number;
last_submitted_result_local_height: number;
last_submitted_result_remote_height: {
revision_number: number;
revision_height: number;
};
deposit: { denom: string; amount: string }[];
submit_timeout: number;
registered_at_height: number;
id: number;
owner: string;
keys: {
path: string;
key: string;
}[];
query_type: string;
transactions_filter: string;
connection_id: string;
update_period: number;
last_submitted_result_local_height: number;
last_submitted_result_remote_height: {
revision_number: number;
revision_height: number;
};
deposit: { denom: string; amount: string }[];
submit_timeout: number;
registered_at_height: number;
}> =>
client.queryContractSmart(contractAddress, {
get_registered_query: {
Expand All @@ -549,8 +547,8 @@ export const waitForICQResultWithRemoteHeight = (
client,
() => getRegisteredQuery(client, contractAddress, queryId),
async (query) =>
query.registered_query.last_submitted_result_remote_height
.revision_height >= targetHeight,
+query.last_submitted_result_remote_height.revision_height >=
targetHeight,
numAttempts,
);

Expand Down Expand Up @@ -581,7 +579,7 @@ export const waitForTransfersAmount = (
client,
async () =>
(await queryTransfersNumber(client, contractAddress)).transfers_number,
async (amount) => amount == expectedTransfersAmount,
async (amount) => amount.toString() == expectedTransfersAmount.toString(),
numAttempts,
);

Expand Down
14 changes: 7 additions & 7 deletions src/testcases/parallel/interchain_tx_query_resubmit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,17 @@ describe('Neutron / Interchain TX Query Resubmit', () => {

test('check registered transfers query', async () => {
const query = await getRegisteredQuery(neutronClient, contractAddress, 1);
expect(query.registered_query.id).toEqual(1);
expect(query.registered_query.owner).toEqual(contractAddress);
expect(query.registered_query.keys.length).toEqual(0);
expect(query.registered_query.query_type).toEqual('tx');
expect(query.registered_query.transactions_filter).toEqual(
expect(query.id).toEqual('1');
expect(query.owner).toEqual(contractAddress);
expect(query.keys.length).toEqual(0);
expect(query.query_type).toEqual('tx');
expect(query.transactions_filter).toEqual(
'[{"field":"transfer.recipient","op":"Eq","value":"' +
watchedAddr1 +
'"}]',
);
expect(query.registered_query.connection_id).toEqual(connectionId);
expect(query.registered_query.update_period).toEqual(query1UpdatePeriod);
expect(query.connection_id).toEqual(connectionId);
expect(query.update_period).toEqual(query1UpdatePeriod.toString());
});

test('check failed txs', async () => {
Expand Down
Loading
Loading