Skip to content
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 batch calls for faster deployment #58

Closed
wants to merge 6 commits into from
Closed

Conversation

Maar-io
Copy link
Contributor

@Maar-io Maar-io commented Mar 27, 2023

Replaced with #62

@@ -129,6 +131,22 @@ where
Ok(())
}

/// Used to add an asset to a vector of tokens.
/// tokenId - ID of the token to add the asset to
/// assetId - ID of the asset to add to the token
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix comment. It is a vec now

@boyswan
Copy link
Contributor

boyswan commented Mar 28, 2023

I wonder if these could be added as a separate Batch trait, as they're for a very specific use case and many users will likely not need them.

Are we also sure these should be part of the library itself? It would be fairly straightforward for a user to implement these in their own contract if they required them, we could have an example contract to demonstrate. This way we wouldn't have to commit to arbitrary iteration limits, as well as maintaining functionality that is possibly a user concern rather than a library concern.

My other thought is that smart contracts aren't really designed for large iteration, so it makes me think that the problem lies elsewhere and that this will just be a means to an end. I do think that this is a bit of an anti-pattern.

@Maar-io Maar-io requested review from boyswan and bobo-k2 March 28, 2023 13:29
@Maar-io
Copy link
Contributor Author

Maar-io commented Mar 28, 2023

I agree with your comment that batch calls should not be in the library files.
I added a separate trait in rmrk/batch.rs
Please take a look if you had something like this in mind (code not complete)
https://github.com/rmrk-team/rmrk-ink/tree/feature/batch2

@boyswan
Copy link
Contributor

boyswan commented Mar 29, 2023

I agree with your comment that batch calls should not be in the library files. I added a separate trait in rmrk/batch.rs Please take a look if you had something like this in mind (code not complete) https://github.com/rmrk-team/rmrk-ink/tree/feature/batch2

Really like this, much cleaner!

@Maar-io Maar-io closed this Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants