-
Notifications
You must be signed in to change notification settings - Fork 279
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
refactor(multisig)!: move from triggers to custom instructions #5217
base: main
Are you sure you want to change the base?
refactor(multisig)!: move from triggers to custom instructions #5217
Conversation
e8e1316
to
a6b0dce
Compare
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.
amazing stuff, so much better
5b0dbeb
to
4e4a6b9
Compare
48753cb
to
0e4fc3a
Compare
BREAKING CHANGES: - (api-changes) `MultisigRegister` `MultisigPropose` `MultisigApprove` custom instructions Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
…ssions Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
…ions Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
e0390e9
to
f3eae2c
Compare
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
f3eae2c
to
bd20861
Compare
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
…ecution" This reverts commit 17287d3. Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
Updates:
Left to next PR #4930 (comment):
|
8ff9018
to
35b3865
Compare
Updates:
|
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
This reverts commit 9108bb7. Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
0306c05
to
6eac0f6
Compare
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.
Only minor comments, otherwise LGTM
let approver = approvers.next().unwrap(); | ||
let res = alt_client(approver, &test_client).submit_blocking(approve.clone()); | ||
match (&transaction_ttl_ms_opt, &unauthorized_target_opt) { | ||
(None, None) => assert!(res.is_ok()), |
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.
nit: (here and below) res.unwrap()
and res.unwrap_err()
provide better diagnostics than plain assert!(res.is_ok())
, since they would print the error message
} | ||
|
||
if role.id().name().as_ref().starts_with(MULTISIG_SIGNATORY) { | ||
if let Some(multisig_account) = multisig_account_from(role.id()) { |
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
let Some(multisig_account) = multisig_account_from(role.id()) else {
deny!(executor, "violates multisig role name format")
}
work here? I find it when the shorter case of the if-else comes first it's easier to read.
); | ||
|
||
if is_expired { | ||
// TODO Notify that the proposal has expired, while returning Ok for the entry deletion to take effect |
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 using Log
instruction work here? Or do you have some kind of client-retrievable notification?
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.
Good idea. Reflected every feedback in another PR #5240
Context
Solution
Migration Guide
MultisigRegister
MultisigPropose
MultisigApprove
custom instructions that replaceMultisigAccountArgs
MultisigTransactionsArgs
CanRegisterAnyTrigger
CanUnregisterAnyTrigger
permissions that become useless and are unlikely to be usedFuture Work
#[derive(CustomInstruction)]
or something for custom instructions #5221Grant::account_role
behavior in custom instructions #5222 infers potential bug/crates
and/samples
#5225Checklist
CONTRIBUTING.md
.