-
Notifications
You must be signed in to change notification settings - Fork 6
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
Refactor and enhance evolution collection precompile with tests and new functionalities #634
Conversation
…rimenting_with_benchmarks
/describe |
PR Description updated to latest commit (9055c58) |
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.
If you intend to implement my suggestions, I will re-review the PR.
If you decide not to implement my suggestions, I will just approve the PR.
type AccountStore = System; | ||
type RuntimeHoldReason = (); | ||
type DustRemoval = (); | ||
type WeightInfo = (); |
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.
Another suggestion, no need to implement it in this PR. To avoid redeclaring types for every mock and runtime, you can use the with_default
macro together with the TestDefaultConfig
in the laos-evolution
pallet. There's an example in the polkadot-sdk: https://github.com/paritytech/polkadot-sdk/blob/3c213726cf165d8b1155d5151b9c548e879b5ff8/substrate/frame/sudo/src/lib.rs#L152-L185
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.
good point with_default
is very handy ... let's try to use it in a refactor in a new PR
…ate_collection_gas
…iles' into estimate_create_collection_gas
* poc * fmt * fmt * better assert * better assert * better assert * better comments * update weights using runtime benchmarking
I suggest taking a look at #633 which adds some test and missing runtime weights. It could complement your changes and add value |
Include gas estimation for `create collection` and `owner`
PR Type
Enhancement, Tests
Description
pallet_laos_evolution
.Changes walkthrough 📝
tests.rs
Refactor and enhance precompile tests with new functionalities.
precompile/evolution-collection/src/tests.rs
create_collection
andmint
functions to useEvmDataWriter
.tests.rs
Add comprehensive tests for evolution collection precompile.
pallets/laos-evolution/src/precompiles/evolution_collection/tests.rs
handling.
MockHandle
andEvmDataWriter
for test setup.tests.rs
Refactor and enhance precompile factory tests with new
functionalities.
precompile/evolution-collection-factory/src/tests.rs
lib.rs
Implement new precompile actions and refactor existing functions.
precompile/evolution-collection/src/lib.rs
Action
enum for function selectors.Precompile
trait forEvolutionCollectionPrecompile
.EvmDataWriter
andLogsBuilder
.revert_dispatch_error
.weights.rs
Update autogenerated weights for pallet_laos_evolution.
pallets/laos-evolution/src/weights.rs
pallet_laos_evolution
.mod.rs
Add new precompile set for evolution collection.
pallets/laos-evolution/src/precompiles/evolution_collection/mod.rs
EvmDataWriter
andLogsBuilder
for function implementation.mod.rs
Update module visibility in runtime configuration.
runtime/laos/src/configs/mod.rs
evm
andlaos_evolution
modules public.