Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/add_simulateXXQu…
Browse files Browse the repository at this point in the history
…eries
  • Loading branch information
jcompagni10 committed Sep 19, 2024
2 parents 723d79f + 979f9cc commit 863f639
Show file tree
Hide file tree
Showing 10 changed files with 1,392 additions and 607 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"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:dex_grpc && yarn test:dex_bindings && yarn test:slinky && yarn test:chain_manager && yarn test:tokenfactory",
"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",
"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",
"test:grpc_queries": "vitest --run src/testcases/parallel/grpc_queries --bail 1",
"test:interchaintx": "vitest --run src/testcases/run_in_band/interchaintx --bail 1",
"test:interchain_kv_query": "vitest --run src/testcases/run_in_band/interchain_kv_query --bail 1",
Expand Down Expand Up @@ -44,8 +45,8 @@
"@cosmjs/cosmwasm-stargate": "^0.32.4",
"@cosmjs/stargate": "0.32.4",
"@cosmjs/tendermint-rpc": "^0.32.4",
"@neutron-org/neutronjs": "https://github.com/neutron-org/neutronjs.git#1e70c1f68e997857f42bab7647227c8ca9dc8aa1",
"@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#1e4527ef6971f4dc2c202cb3cc2a50b0a4491f54",
"@neutron-org/neutronjs": "https://github.com/neutron-org/neutronjs.git#7f45328320b53b4fa2b572bc25bb96bf80260181",
"@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#df604d8c6475c8640f4ee2ded9b1905574226a3a",
"@types/lodash": "^4.14.182",
"axios": "1.6.0",
"commander": "^10.0.0",
Expand Down Expand Up @@ -89,4 +90,4 @@
"engines": {
"node": ">=20.0"
}
}
}
1 change: 1 addition & 0 deletions src/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const CONTRACTS = {
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
87 changes: 50 additions & 37 deletions src/testcases/parallel/governance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,18 @@ describe('Neutron / Governance', () => {
'Proposal #11',
'',
'1000',
'proposal11',
5,
[
{
contract: contractAddress,
msg: '{"test_msg": {"return_err": false, "arg": "proposal_11"}}',
},
],
{
name: 'proposal11',
period: 5,
msgs: [
{
contract: contractAddress,
msg: '{"test_msg": {"return_err": false, "arg": "proposal_11"}}',
},
],
execution_stage: 'EXECUTION_STAGE_BEGIN_BLOCKER',
},
true, // just to check that bindings are ok
);
});

Expand All @@ -330,7 +334,10 @@ describe('Neutron / Governance', () => {
'Proposal #12',
'',
'1000',
'proposal11',
{ name: 'proposal11' },
'single',
true,
true,
);
});

Expand All @@ -341,22 +348,25 @@ describe('Neutron / Governance', () => {
'Proposal #13',
'',
'1000',
'proposal13',
5,
[
{
contract: contractAddress,
msg: '{"test_msg": {"return_err": true, "arg": ""}}',
},
{
contract: contractAddress,
msg: '{"incorrect_format": {"return_err": false, "arg": "proposal_11"}}',
},
{
contract: contractAddress,
msg: '{"test_msg": {"return_err": false, "arg": "three_messages"}}',
},
],
{
name: 'proposal13',
period: 5,
msgs: [
{
contract: contractAddress,
msg: '{"test_msg": {"return_err": true, "arg": ""}}',
},
{
contract: contractAddress,
msg: '{"incorrect_format": {"return_err": false, "arg": "proposal_11"}}',
},
{
contract: contractAddress,
msg: '{"test_msg": {"return_err": false, "arg": "three_messages"}}',
},
],
execution_stage: 'EXECUTION_STAGE_BEGIN_BLOCKER',
},
);
});

Expand All @@ -367,18 +377,21 @@ describe('Neutron / Governance', () => {
'Proposal #14',
'',
'1000',
'proposal14',
5,
[
{
contract: contractAddress,
msg: '{"test_msg": {"return_err": false, "arg": "correct_msg"}}',
},
{
contract: contractAddress,
msg: '{"test_msg": {"return_err": true, "arg": ""}}',
},
],
{
name: 'proposal14',
period: 5,
msgs: [
{
contract: contractAddress,
msg: '{"test_msg": {"return_err": false, "arg": "correct_msg"}}',
},
{
contract: contractAddress,
msg: '{"test_msg": {"return_err": true, "arg": ""}}',
},
],
execution_stage: 'EXECUTION_STAGE_BEGIN_BLOCKER',
},
);
});

Expand Down
22 changes: 21 additions & 1 deletion src/testcases/parallel/grpc_queries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { SigningNeutronClient } from '../../helpers/signing_neutron_client';
import { defaultRegistryTypes, SigningStargateClient } from '@cosmjs/stargate';
import { Registry } from '@cosmjs/proto-signing';
import { MsgTransfer } from '@neutron-org/neutronjs/ibc/applications/transfer/v1/tx';
import { QueryClientImpl as IbcQueryClient } from '@neutron-org/neutronjs/ibc/applications/transfer/v1/query.rpc.Query';
import { MsgCreateDenom } from '@neutron-org/neutronjs/osmosis/tokenfactory/v1beta1/tx';
import { COSMOS_DENOM, NEUTRON_DENOM } from '../../helpers/constants';
import config from '../../config.json';
Expand All @@ -23,6 +24,8 @@ describe('Neutron / Grpc Queries', () => {

let newTokenDenom: string;

let ibcQuerier: IbcQueryClient;

beforeAll(async (suite: RunnerTestSuite) => {
testState = await LocalState.create(config, inject('mnemonics'), suite);

Expand All @@ -38,6 +41,9 @@ describe('Neutron / Grpc Queries', () => {
gaiaWallet.directwallet,
{ registry: new Registry(defaultRegistryTypes) },
);

const neutronRpcClient = await testState.neutronRpcClient();
ibcQuerier = new IbcQueryClient(neutronRpcClient);
});

describe('Prepare for queries', () => {
Expand Down Expand Up @@ -160,7 +166,21 @@ describe('Neutron / Grpc Queries', () => {
},
});
expect(res.denom_trace.path).toBe('transfer/channel-0');
expect(res.denom_trace.base_denom).toBe('uatom');
expect(res.denom_trace.base_denom).toBe(COSMOS_DENOM);
});

test('transfer escrow address should work', async () => {
const res = await neutronClient.queryContractSmart(contractAddress, {
transfer_escrow_address: {
port_id: 'transfer',
channel_id: 'channel-0',
},
});
const res2 = await ibcQuerier.escrowAddress({
portId: 'transfer',
channelId: 'channel-0',
});
expect(res2.escrowAddress).toBe(res.escrow_address);
});

// response with the field of type `Any` is expected, but actual type is a different struct
Expand Down
5 changes: 4 additions & 1 deletion src/testcases/parallel/subdao.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,12 @@ describe('Neutron / Subdao', () => {
'Proposal #12',
'',
'1000',
'proposal11',
{
name: 'proposal11',
},
'single_nt_pause',
false,
true,
);
await subdaoMember1.voteYes(proposalId, 'single_nt_pause');

Expand Down
Loading

0 comments on commit 863f639

Please sign in to comment.