-
Notifications
You must be signed in to change notification settings - Fork 121
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: pallet/asset: implement status_change() call #277
Conversation
Signed-off-by: Amar Tumballi <amar@dhiway.com>
c62557d
to
c9390f3
Compare
Signed-off-by: Amar Tumballi <amar@dhiway.com>
@smohan-dw does this makes sense now? @adi-a11y the companion PR in cord.js would change too. |
Signed-off-by: Amar Tumballi <amar@dhiway.com>
Signed-off-by: Amar Tumballi <amar@dhiway.com>
@smohan-dw as per the discussion, for now, only 3 states are good, and this Good to go IMO. I know this needs a version change in runtime, when deployed. But I am not sure if that should be with this PR, or a separate PR before a release (mentioning all changes in one shot). |
pallets/asset/src/lib.rs
Outdated
|
||
#[pallet::call_index(3)] | ||
#[pallet::weight({0})] | ||
pub fn revoke( |
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.
Revoke in asset context is a status change according to the AssetStatusOf enum. If the asset status is inactive or expired, no more issuance should happen. We need to check the expected behaviour of transfers if the underlying asset is not active.
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.
The logic of transfer and issuance only checks for 'ACTIVE' already in code, so any other status change would result in stopping of transfer and issuance from happening.
pub fn revoke( | ||
origin: OriginFor<T>, | ||
asset_id: AssetIdOf, | ||
instance_id: Option<AssetInstanceIdOf>, |
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.
We need to implement the status change behaviour for assets and instances separately.
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.
@smohan-dw looks like the comment is bit older than the review. Currently, the status change takes instance status change if instance is sent. Asset state is not changed. If instance is None, then asset status change happens.
Signed-off-by: Amar Tumballi <amar@dhiway.com>
Merging this as @smohan-dw's approval was present for commit without the version change. With this, we will be comfortable to update the existing chain without any major issues. |
Fixes #267