Skip to content

Commit

Permalink
Merge pull request #345 from neutron-org/feat/add-cron-integration-tests
Browse files Browse the repository at this point in the history
feat: added tests for cron module #NTRN-386
  • Loading branch information
pr0n00gler authored Sep 16, 2024
2 parents daa2042 + 7dd6ac8 commit 8fd622e
Show file tree
Hide file tree
Showing 7 changed files with 363 additions and 53 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: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
83 changes: 46 additions & 37 deletions src/testcases/parallel/governance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,17 @@ 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',
},
);
});

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

Expand All @@ -341,22 +344,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 +373,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
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 8fd622e

Please sign in to comment.