-
Notifications
You must be signed in to change notification settings - Fork 692
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
pallet assets: Fix errors #4118
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
title: "pallet assets: minor improvement on errors returned for some calls" | ||
|
||
doc: | ||
- audience: Runtime Dev | ||
description: | | ||
Some calls in pallet assets have better errors. No new error is introduced, only more sensible choice are made. | ||
- audience: Runtime User | ||
description: | | ||
Some calls in pallet assets have better errors. No new error is introduced, only more sensible choice are made. | ||
|
||
crates: | ||
- name: pallet-assets | ||
bump: minor |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -491,7 +491,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> { | |
let d = Asset::<T, I>::get(&id).ok_or(Error::<T, I>::Unknown)?; | ||
ensure!( | ||
d.status == AssetStatus::Live || d.status == AssetStatus::Frozen, | ||
Error::<T, I>::AssetNotLive | ||
Error::<T, I>::IncorrectStatus | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't we say There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm personally fine with There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah, it helps us, but not sure someone using a UI would get any info with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think Rust enum errors are supposed to be shown directly to end-users in UIs? I always understood them as more for developers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some UI might show the doc: Considering there is 3 status I think it is ok |
||
); | ||
|
||
let actual = Self::decrease_balance(id.clone(), target, amount, f, |actual, details| { | ||
|
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.
I feel information is not useful, but in theory it impacts both dev for maybe test to udpate and frontend.
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.
in theory it is kind of a major breaking change :-(