Draft
Conversation
Daanvdplas
commented
Feb 18, 2025
| use Read::*; | ||
| match request { | ||
| TotalSupply(_) => <T as Config>::WeightInfo::total_supply(), | ||
| TotalSupply(id) => <T as Config>::WeightInfo::total_supply(weight_param(id)), |
Collaborator
Author
There was a problem hiding this comment.
This hasn't been tested but applied to show how the weight can be handled for the read functions.
253d80e to
142072c
Compare
Daanvdplas
commented
Feb 18, 2025
| #[benchmark] | ||
| // Storage: `Assets` | ||
| fn total_supply() { | ||
| fn total_supply(a: Linear<0, 1>) { |
Collaborator
Author
There was a problem hiding this comment.
Not tested but I was thinking to implement it this way if we went this route.
Daanvdplas
commented
Feb 18, 2025
| type TrustBackedAssetsInstance; | ||
| /// The asset instance for foreign assets. | ||
| type ForeignAssetsInstance; | ||
| type Balance: Parameter |
Collaborator
Author
There was a problem hiding this comment.
Complex Balance type unfortunately
Daanvdplas
commented
Feb 18, 2025
|
|
||
| #[derive(Debug, PartialEq, Eq, Clone)] | ||
| #[ink::scale_derive(Encode, Decode, TypeInfo)] | ||
| pub enum TokenId { |
Collaborator
Author
There was a problem hiding this comment.
Only change required in the fungibles api crate apart from the XCM stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Close annotations in the
Files changedsection by clicking the right corner 3 dots when reviewing because I only pushed the relevant bits)Shows how we can implement the foreign fungibles functionality by creating a wrapper type in the fungibles pallet & api. This reduces the amount of duplicate code but adds some complexity to the pallet (i.e. benchmarking, types).
See latest commit to get a feel for the contract. This is just the fungibles contract updated and can both be used for the fungibles as foreign fungibles use case.
Fungibles contract without
foreign_fungiblesfeature enabled: 14.5K (see latest commit), disabled: 22.8K (fungibles contract was 14.2K)Integrations tests for
transferandbalance_ofare working.