Skip to content

Commit

Permalink
fix: review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ratik committed Nov 17, 2022
1 parent e8e3682 commit f75f234
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
17 changes: 0 additions & 17 deletions src/testcases/interchain_kv_query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,23 +531,6 @@ describe('Neutron / Interchain KV Query', () => {
});
});

describe('update recipient and check', () => {
it("should not update recipient bc it's a KV query", async () => {
await expect(
cm[1].executeContract(
contractAddress,
JSON.stringify({
update_interchain_query: {
query_id: 1,
new_update_period: 4,
new_recipient: 'cosmos1jy7lsk5pk38zjfnn6nt6qlaphy9uejn4hu65xa',
},
}),
),
).rejects.toThrow(/wrong query type/);
});
});

describe('Remove interchain query', () => {
test('remove icq #1', async () => {
let balances = await cm[1].queryBalances(contractAddress);
Expand Down
12 changes: 5 additions & 7 deletions src/testcases/interchain_tx_query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -639,21 +639,20 @@ describe('Neutron / Interchain TX Query', () => {
JSON.stringify({
update_interchain_query: {
query_id: 3,
new_update_period: 5,
new_update_period: query3UpdatePeriod,
new_recipient: newWatchedAddr5,
},
}),
);
expect(res.code).toEqual(0);
});
it('seems registered transfers query is updated', async () => {
await waitBlocks(cm.sdk, 10);
const query = await getRegisteredQuery(cm, contractAddress, 3);
expect(query.registered_query.id).toEqual(3);
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.update_period).toEqual(5);
expect(query.registered_query.update_period).toEqual(query3UpdatePeriod);
expect(query.registered_query.transactions_filter).toEqual(
'[{"field":"transfer.recipient","op":"Eq","value":"' +
newWatchedAddr5 +
Expand All @@ -670,19 +669,18 @@ describe('Neutron / Interchain TX Query', () => {
cm,
contractAddress,
expectedIncomingTransfers,
query1UpdatePeriod * 5,
query3UpdatePeriod * 2,
);
const deposits = await queryRecipientTxs(
cm,
contractAddress,
newWatchedAddr5,
);
expect(deposits.transfers).toEqual([
expect(deposits.transfers).toMatchObject([
{
recipient: watchedAddr1,
recipient: newWatchedAddr5,
sender: cm2.wallet.address.toString(),
denom: cm2.denom,
amount: addr1ExpectedBalance.toString(),
},
]);
});
Expand Down

0 comments on commit f75f234

Please sign in to comment.