Skip to content

Commit

Permalink
add tests for cron module
Browse files Browse the repository at this point in the history
  • Loading branch information
joldie777 committed Sep 5, 2024
1 parent c533ce8 commit 757e87e
Show file tree
Hide file tree
Showing 5 changed files with 345 additions and 49 deletions.
7 changes: 4 additions & 3 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:dex_grpc && yarn test:dex_bindings && 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 @@ -42,7 +43,7 @@
"@cosmjs/stargate": "0.32.4",
"@cosmjs/tendermint-rpc": "^0.32.4",
"@neutron-org/neutronjs": "4.2.0",
"@neutron-org/neutronjsplus": "0.5.0",
"@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#90419a2508b4a62e646c9449c983a4640643ad83",
"@types/lodash": "^4.14.182",
"axios": "1.6.0",
"commander": "^10.0.0",
Expand Down Expand Up @@ -85,4 +86,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
Loading

0 comments on commit 757e87e

Please sign in to comment.