Skip to content

Commit

Permalink
feat: test error
Browse files Browse the repository at this point in the history
  • Loading branch information
ratik committed Dec 29, 2023
1 parent 52c3fe1 commit 087a570
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion integration_tests/src/testcases/puppeteer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ import {
DelegationsResponse,
Transfer,
} from '../generated/contractLib/lidoPuppeteer';
import { ResponseHookSuccessMsg } from '../generated/contractLib/lidoHookTester';
import {
ResponseHookErrorMsg,
ResponseHookSuccessMsg,
} from '../generated/contractLib/lidoHookTester';

const PuppeteerClass = LidoPuppeteer.Client;
const HookTesterClass = LidoHookTester.Client;
Expand Down Expand Up @@ -506,4 +509,34 @@ describe('Interchain puppeteer', () => {
last_updated_height: expect.any(Number),
});
});

it('send a failing delegation', async () => {
const { hookContractClient, account } = context;

const res = await hookContractClient.delegate(
account.address,
{
validator: context.firstValidatorAddress,
amount: '10000000000000',
timeout: 1000,
},
1.5,
undefined,
[{ amount: '1000000', denom: 'untrn' }],
);
expect(res.transactionHash).toBeTruthy();
await context.park.pauseNetwork('gaia');
});
it('query error', async () => {
const { hookContractClient } = context;
let res: ResponseHookErrorMsg[] = [];
await waitFor(async () => {
res = await hookContractClient.queryErrors();
return res.length > 0;
}, 40_000);
expect(res.length).toEqual(1);
expect(res[0].details).toEqual(
'ABCI code: 107: error handling packet: see events for details',
);
});
});

0 comments on commit 087a570

Please sign in to comment.