-
Notifications
You must be signed in to change notification settings - Fork 690
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 NonFungibleAdapter
#2924
Add NonFungibleAdapter
#2924
Conversation
Co-authored-by: Francisco Aguirre <[email protected]>
@joepetrowski Could you take a look at this? |
Yeah I can review, but if it's for Coretime then I think @seadanda knows this better. |
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.
Looks good, just needs an update to XCM v4 syntax.
fn accrue_checked(checking_account: AccountId, instance: Asset::ItemId) { | ||
let ok = Asset::mint_into(&instance, &checking_account).is_ok(); | ||
debug_assert!(ok, "`mint_into` cannot generally fail; qed"); | ||
} | ||
fn reduce_checked(instance: Asset::ItemId) { | ||
let ok = Asset::burn(&instance, None).is_ok(); | ||
debug_assert!(ok, "`can_check_in` must have returned `true` immediately prior; qed"); | ||
} |
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.
Perhaps these should be proper log messages and not debug_assert
s. You are assuming that the user has e.g. called can_check_in
prior to calling this function, but there is no guarantee. If the trait doesn't allow you to return an error here, should probably log it.
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 used debug_assert
here to keep consistent with other adapter implementations.
Co-authored-by: Dónal Murray <[email protected]>
The CI pipeline was cancelled due to failure one of the required jobs. |
The CI pipeline was cancelled due to failure one of the required jobs. |
@Szegoo seems like after fixing a conflict this can be merged |
@franciscoaguirre Resolved the conflict, should be ready for merging now. |
6633253
This PR introduces a new
NonFungibleAdapter
.It will be useful for enabling cross-chain Coretime region transfers, as the existing
NonFungiblesAdapter
is unsuitable for this purpose. This is due to the fact that there is only one class of items within thepallet-broker
, i.e., the Coretime regions.