Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: whitelist tf hooks #314

Merged
merged 26 commits into from
Jul 4, 2024
Merged

feat: whitelist tf hooks #314

merged 26 commits into from
Jul 4, 2024

Conversation

jcompagni10
Copy link
Contributor

@jcompagni10 jcompagni10 commented Jun 20, 2024

sotnikov-s
sotnikov-s previously approved these changes Jun 21, 2024
pr0n00gler
pr0n00gler previously approved these changes Jul 1, 2024
@pr0n00gler pr0n00gler dismissed their stale review July 1, 2024 14:47

Please attach a successfull testrun

src/testcases/parallel/tokenfactory.test.ts Outdated Show resolved Hide resolved
src/testcases/parallel/tokenfactory.test.ts Outdated Show resolved Hide resolved
@sotnikov-s
Copy link
Contributor

the rest LGTM

@jcompagni10
Copy link
Contributor Author

Copy link
Contributor

@sotnikov-s sotnikov-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excuse me, one more thing. please add a test that asserts that hooks fail if not whitelisted

newTokenDenom,
contractAddress,
);
expect(res.code).not.toEqual(0); // set hook fails
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be more accurate to check that the exact error is returned, not that just something went wrong

newTokenDenom,
contractAddress,
);
expect(res2.code).toEqual(14); // "beforeSendHook is not whitelisted"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's good enough to check the code, but just FYI for the future: a more convenient IMO way to check errors is by the error message e.g. like here (or actually in many other places in our tests)

await expect(
tgeWallets[v].executeContract(
tgeMain.contracts.lockdrop,
JSON.stringify({
claim_rewards_and_optionally_unlock: {
pool_type: 'ATOM',
duration: 1,
withdraw_lp_stake: false,
},
}),
),
).rejects.toThrowError(/LockupInfoV1 not found/);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be mistaken but the way msgSetBeforeSendHook is called I can't use rejects

Comment on lines +59 to +66
let timelockedProp = await subdaoMember1.supportAndExecuteProposal(
proposalId,
);
await waitSeconds(10);
await subdaoMember1.executeTimelockedProposal(proposalId);
timelockedProp = await subDao.getTimelockedProposal(proposalId);
expect(timelockedProp.id).toEqual(proposalId);
expect(timelockedProp.status).toEqual('executed');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't this (speeded up?) approach work? I can see that you added it and then removed in the latest commits
image

sotnikov-s
sotnikov-s previously approved these changes Jul 3, 2024
Copy link
Contributor

@sotnikov-s sotnikov-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments above are only informative, so approving it

@pr0n00gler
Copy link
Collaborator

@pr0n00gler pr0n00gler merged commit 43b9d50 into main Jul 4, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants