-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[9/x][programmable transactions] Added errors #8767
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
/// Errors if out of bounds, if the argument is borrowed, if it is unavailable (already taken), | ||
/// or if it is an object that cannot be taken by value (shared or immutable) | ||
pub fn take_arg<V: TryFromValue>( | ||
pub fn by_value_arg<V: TryFromValue>( |
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.
Thanks for the suggestion @amnn!
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.
LGTM!
@@ -2357,6 +2376,22 @@ pub struct InvalidSharedByValue { | |||
pub object: ObjectID, | |||
} | |||
|
|||
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Hash)] | |||
pub enum CommandArgumentError { |
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 benefit from some docs:
- An overall doc comment reminding folks that these come from programmable transaction commands.
- A short description of how these errors come about (especially for the
Invalid*
errors -- what makes those things invalid?)
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.
(Or alternatively, a pointer in the outer doc comment to say that the Display
implementation has this information
-- is there any chance we could use thiserror
for this to bring these two things together?).
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.
Oooo fancy, will do
- Replaced panics with execution errors
Removed the error for unused input, so should fix #8776 |
## Description Adds a programmable transaction builder. APIs are there mostly for migration. Builds on #8767 ## Test Plan Not yet in use --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes
Description
Replaced panics with execution errors
Test Plan
👀
If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.
Type of Change (Check all that apply)
Release notes