Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Aug 8, 2024
1 parent 40dd2d9 commit f86752d
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions src/testcases/run_in_band/interchaintx.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
/* eslint-disable prettier/prettier */
import { IndexedTx, JsonObject } from '@cosmjs/cosmwasm-stargate';
import '@neutron-org/neutronjsplus';
import { getSequenceId } from '@neutron-org/neutronjsplus/dist/cosmos';
import { defaultRegistryTypes } from '@cosmjs/stargate';
import { Registry } from '@cosmjs/proto-signing';
import { CONTRACTS, COSMOS_DENOM, NEUTRON_DENOM } from '../../helpers/constants';
import {
CONTRACTS,
COSMOS_DENOM,
NEUTRON_DENOM,
} from '../../helpers/constants';
import { LocalState } from '../../helpers/local_state';
import { RunnerTestSuite, inject } from 'vitest';
import { SigningNeutronClient } from '../../helpers/signing_neutron_client';
import { SigningStargateClient } from '@cosmjs/stargate';

import {
QueryClientImpl as StakingQueryClient,
QueryDelegatorDelegationsResponse,
Expand All @@ -23,14 +25,18 @@ import {
QueryFailuresResponse,
} from '@neutron-org/cosmjs-types/neutron/contractmanager/query';
import { getWithAttempts } from '../../helpers/misc';

import config from '../../config.json';
import { Wallet } from '../../helpers/wallet';
import { AcknowledgementResult, cleanAckResults, getAck, getAcks, waitForAck } from '../../helpers/interchaintxs';
import {
AcknowledgementResult,
cleanAckResults,
getAck,
getAcks,
waitForAck,
} from '../../helpers/interchaintxs';
import config from '../../config.json';

describe('Neutron / Interchain TXs', () => {
let testState: LocalState;

let contractAddress: string;
let icaAddress1: string;
let icaAddress2: string;
Expand Down Expand Up @@ -301,7 +307,9 @@ describe('Neutron / Interchain TXs', () => {
const res1 = await getWithAttempts(
gaiaClient,
() =>
gaiaStakingQuerier.DelegatorDelegations({ delegatorAddr: icaAddress1 }),
gaiaStakingQuerier.DelegatorDelegations({
delegatorAddr: icaAddress1,
}),
async (delegations) => delegations.delegationResponses?.length == 1,
);
expect(res1.delegationResponses).toEqual([
Expand Down Expand Up @@ -832,17 +840,17 @@ describe('Neutron / Interchain TXs', () => {
expect.objectContaining({
address: contractAddress,
id: 0n,
error: 'codespace: wasm, code: 5', // execute wasm contract failer
error: 'codespace: wasm, code: 5', // execute wasm contract failed
}),
expect.objectContaining({
address: contractAddress,
id: 1n,
error: 'codespace: wasm, code: 5', // execute wasm contract failer
error: 'codespace: wasm, code: 5', // execute wasm contract failed
}),
expect.objectContaining({
address: contractAddress,
id: 2n,
error: 'codespace: wasm, code: 5', // execute wasm contract failer
error: 'codespace: wasm, code: 5', // execute wasm contract failed
}),
expect.objectContaining({
address: contractAddress,
Expand Down Expand Up @@ -937,8 +945,8 @@ describe('Neutron / Interchain TXs', () => {
const acks = await getAcks(neutronClient, contractAddress);
expect(acks.length).toEqual(1);
expect(acks[0].sequence_id).toEqual(
+JSON.parse(Buffer.from(failure.sudoPayload).toString())
.response.request.sequence,
+JSON.parse(Buffer.from(failure.sudoPayload).toString()).response
.request.sequence,
);
});
});
Expand Down

0 comments on commit f86752d

Please sign in to comment.