-
Notifications
You must be signed in to change notification settings - Fork 18
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
Conversation
the rest LGTM |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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)
neutron-integration-tests/src/testcases/run_in_band/tge.auction.test.ts
Lines 1977 to 1988 in 601f061
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/); |
There was a problem hiding this comment.
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
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'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this 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
for neutron-org/neutron#587 -- Allow chain manager dao to whitelist tokenfactory hooks
Related PRs
neutron-org/neutron-dao#107
neutron-org/neutron-sdk#150
neutron-org/neutronjsplus#43
Integration Test Run
https://github.com/neutron-org/neutron-tests/actions/runs/9765613806