3

My pallet has over 1,000 lines of codes so far(already separated implementation of the call functions). Over 30 call functions which are pretty messy to maintain.

Should I split them into small pallets and couple them all together? Should I split the test file and benchmarking as well?

1 Answer 1

4

I'd suggest to take a look at some of the FRAME pallets. The balances pallet is a good example, it has the test file, benchmarking, types and different traits implementations in their own files.

Take a look into the nfts-pallet, it has more than 30 call functions too, and another example of a even bigger pallet is the staking pallet, where it splits some logic in their own pallets.

Also I'd like to share with you another interesting resources:

That's a good question, I'd love to see other answers with more feedback about best practices building a pallet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.