Skip to content

Commit

Permalink
fix after removing cron wasmbindings
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Sep 3, 2024
1 parent a7087ff commit 9d61f1c
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 77 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"@cosmjs/cosmwasm-stargate": "^0.32.4",
"@cosmjs/stargate": "0.32.4",
"@cosmjs/tendermint-rpc": "^0.32.4",
"@neutron-org/neutronjs": "4.2.0",
"@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#84114edce716e9673596b392cae080eb84133605",
"@neutron-org/neutronjs": "https://github.com/neutron-org/neutronjs.git#1e53336a65777b3ff87afb59941495f8c98c6c53",
"@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#12aa26cea388716b083b7c0ff4133f3c88452c5c",
"@types/lodash": "^4.14.182",
"axios": "1.6.0",
"commander": "^10.0.0",
Expand Down
87 changes: 48 additions & 39 deletions src/testcases/parallel/governance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
getNeutronDAOCore,
} from '@neutron-org/neutronjsplus/dist/dao';
import { updateInterchaintxsParamsProposal } from '@neutron-org/neutronjsplus/dist/proposal';
import { Suite, inject } from 'vitest';
import { inject, RunnerTestSuite } from 'vitest';
import { NEUTRON_DENOM } from '../../helpers/constants';
import { ParameterChangeProposal } from '@neutron-org/neutronjs/cosmos/params/v1beta1/params';
import { MsgSubmitProposalLegacy } from '@neutron-org/neutronjs/cosmos/adminmodule/adminmodule/tx';
Expand Down Expand Up @@ -48,7 +48,7 @@ describe('Neutron / Governance', () => {
let interchaintxQuery: InterchainTxQueryClient;
let interchainAccountsQuerier: InterchainAccountsQueryClient;

beforeAll(async (suite: Suite) => {
beforeAll(async (suite: RunnerTestSuite) => {
testState = await LocalState.create(config, inject('mnemonics'), suite);
neutronWallet = await testState.nextWallet('neutron');
neutronClient = await SigningNeutronClient.connectWithSigner(
Expand Down 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: 0, // TODO: update neutronjs here
},
);
});

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: 0, // TODO
},
);
});

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: 0,
},
);
});

Expand Down
47 changes: 16 additions & 31 deletions src/testcases/run_in_band/chain_manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
} from '@neutron-org/neutronjsplus/dist/dao';
import { waitSeconds } from '@neutron-org/neutronjsplus/dist/wait';
import {
addCronScheduleProposal,
removeCronScheduleProposal,
updateCronParamsProposal,
updateDexParamsProposal,
updateTokenfactoryParamsProposal,
Expand All @@ -24,7 +22,6 @@ import { QueryClientImpl as TokenfactoryQueryClient } from '@neutron-org/neutron
import { QueryClientImpl as DexQueryClient } from '@neutron-org/neutronjs/neutron/dex/query.rpc.Query';
import { SigningNeutronClient } from '../../helpers/signing_neutron_client';
import config from '../../config.json';
import { chainManagerWrapper } from '@neutron-org/neutronjsplus/src/proposal';

describe('Neutron / Chain Manager', () => {
let testState: LocalState;
Expand Down Expand Up @@ -371,27 +368,22 @@ describe('Neutron / Chain Manager', () => {
const scheduleName = 'schedule1';

test('create addSchedule proposal', async () => {
const info = {
name: 'schedule1',
period: 100,
msgs: [
{
contract: 'whatever',
msg: JSON.stringify({}),
},
],
execution_stage: 0,
};
proposalId = await subdaoMember1.submitSingleChoiceProposal(
proposalId = await subdaoMember1.submitAddSchedule(
chainManagerAddress,
'Add schedule',
'cron add schedule proposal. Will pass',
[
chainManagerWrapper(
chainManagerAddress,
addCronScheduleProposal(info),
),
],
'1000',
{
name: 'schedule1',
period: 100,
msgs: [
{
contract: 'whatever',
msg: JSON.stringify({}),
},
],
execution_stage: 0,
},
);

const timelockedProp = await subdaoMember1.supportAndExecuteProposal(
Expand Down Expand Up @@ -419,19 +411,12 @@ describe('Neutron / Chain Manager', () => {
});

test('create removeSchedule proposal', async () => {
const info = {
name: 'schedule1',
};
proposalId = await subdaoMember1.submitSingleChoiceProposal(
proposalId = await subdaoMember1.submitRemoveSchedule(
chainManagerAddress,
'Add schedule',
'cron add schedule proposal. Will pass',
[
chainManagerWrapper(
chainManagerAddress,
removeCronScheduleProposal(info),
),
],
'1000',
{ name: 'schedule1' },
);

const timelockedProp = await subdaoMember1.supportAndExecuteProposal(
Expand Down
9 changes: 4 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1307,14 +1307,13 @@
resolved "https://registry.yarnpkg.com/@neutron-org/cosmjs-types/-/cosmjs-types-0.9.2-rc1.tgz#ca1fc1dc9566858dbd765e8f82c8a70097bcc84b"
integrity sha512-ju2AqJ14yO4+JF8RwY4ZVy7f2HVjhdf66SfhS6y4ucBZm997/E/yYVMnpWmUncVg8ARooISOKaOYNagqz0am6Q==

"@neutron-org/neutronjs@4.2.0":
"@neutron-org/neutronjs@https://github.com/neutron-org/neutronjs.git#1e53336a65777b3ff87afb59941495f8c98c6c53":
version "4.2.0"
resolved "https://registry.yarnpkg.com/@neutron-org/neutronjs/-/neutronjs-4.2.0.tgz#7d98d4bc1568f22c015736d6fbe768ddfba14798"
integrity sha512-l3ILkT8H6bO522RoNb37NMQkqlp8qvKNm7v6QlzORtClqbM7VbRv2/INgy8wn8USV5AmcnCdl9M4KfvvGw5k9w==
resolved "https://github.com/neutron-org/neutronjs.git#1e53336a65777b3ff87afb59941495f8c98c6c53"

"@neutron-org/neutronjsplus@https://github.com/neutron-org/neutronjsplus.git#84114edce716e9673596b392cae080eb84133605":
"@neutron-org/neutronjsplus@https://github.com/neutron-org/neutronjsplus.git#12aa26cea388716b083b7c0ff4133f3c88452c5c":
version "0.5.0"
resolved "https://github.com/neutron-org/neutronjsplus.git#84114edce716e9673596b392cae080eb84133605"
resolved "https://github.com/neutron-org/neutronjsplus.git#12aa26cea388716b083b7c0ff4133f3c88452c5c"
dependencies:
"@cosmjs/cosmwasm-stargate" "^0.32.4"
"@cosmjs/proto-signing" "^0.32.4"
Expand Down

0 comments on commit 9d61f1c

Please sign in to comment.