-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add a general subintent tx type & make owner key changes reserved #129
Conversation
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.
Nice. No big issues. I realised we were missing a reservation on LOCK metadata for the owner keys; and have a couple of requests for additional tests.
crates/radix-engine-toolkit/src/transaction_types/traverser/types/general_subintent.rs
Outdated
Show resolved
Hide resolved
crates/radix-engine-toolkit/src/transaction_types/traverser/types/general_subintent.rs
Outdated
Show resolved
Hide resolved
crates/radix-engine-toolkit/src/transaction_types/traverser/types/general_subintent.rs
Show resolved
Hide resolved
crates/radix-engine-toolkit/src/transaction_types/traverser/types/general_subintent.rs
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
fn on_instruction(&mut self, instruction: &InstructionV2, _: usize) { |
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.
VERY MINOR / FOR FUTURE: In general, we can use AnyInstruction
here instead of InstructionV2
(it's just an alias for the latest version, which would mean less code needs changing here if we add new instructions in future).
crates/radix-engine-toolkit/src/transaction_types/traverser/auxiliary/reserved_instructions.rs
Show resolved
Hide resolved
} else if is_access_controller(address) { | ||
self.reserved_instructions | ||
.insert(ReservedInstruction::AccessControllerMethod); | ||
// TODO: Make use of the typed manifest invocations - they would make |
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.
👍 Sounds good.
VERY MINOR/OPTIONAL: This logic would probably be a little bit safer as if let Some(reserved) = as_reserved(instruction) { /* add to list */ }
for a fn is_reserved(instruction &AnyInstruction) -> Option<ReservedInstruction> { .. }
| InstructionV2::VerifyParent(_) => true, | ||
/* Not Permitted */ | ||
InstructionV2::BurnResource(..) | ||
| InstructionV2::CallRoyaltyMethod(..) | ||
| InstructionV2::CallMetadataMethod(..) | ||
| InstructionV2::CallRoleAssignmentMethod(..) | ||
| InstructionV2::CallDirectVaultMethod(..) | ||
| InstructionV2::AllocateGlobalAddress(..) => false, | ||
| InstructionV2::AllocateGlobalAddress(..) | ||
| InstructionV2::YieldToChild(_) => false, |
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.
Can we add a test for this? i.e. that a subintent yielding to CHILD is not matched?
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.
Similarly, given it's a requirement for the Gateway to return the correct classification for the MVP, can we have a test where a simple transaction intent manifest which has a YIELD_TO_CHILD is explicitly unclassified? (with a comment that this behaviour is needed for the wallet to mark transactions-with-subintents as Complex; and if changed, we should ensure we change it in line with Gateway and/or wallet behaviour)
No description provided.