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

Refactoring precompiles to use macros #624

Merged
merged 67 commits into from
Jun 18, 2024

Conversation

asiniscalchi
Copy link
Member

@asiniscalchi asiniscalchi commented Jun 12, 2024

PR Type

Enhancement, Tests


Description

  • Refactored Evolution Collection precompile implementation to use macros.
  • Added new precompile functions for minting, evolving, and ownership transfer.
  • Implemented gas cost recording and error handling.
  • Added new legacy precompile implementation.
  • Added and refactored tests for Evolution Collection and legacy precompiles.
  • Updated mock configuration to use new precompile structure.

Changes walkthrough 📝

Relevant files
Tests
tests.rs
Refactor and add tests for Evolution Collection precompiles.

precompile/evolution-collection/src/tests.rs

  • Replaced MockPrecompileSet with LaosPrecompiles.
  • Updated function calls to use new PrecompileCall and
    FactoryPrecompileCall.
  • Added new tests for various precompile functions.
  • Refactored existing tests to use new precompile structure.
  • +225/-318
    tests.rs
    Add tests for legacy evolution collection precompiles.     

    precompile/evolution-collection-legacy/src/tests.rs

  • Added new test file for legacy evolution collection precompiles.
  • Implemented tests for minting, evolving, and ownership transfer.
  • +681/-0 
    tests.rs
    Add and refactor tests for Laos Evolution pallet.               

    pallets/laos-evolution/src/tests.rs

  • Added tests for slot and owner to token ID conversion.
  • Updated tests to use new Slot type.
  • Refactored existing tests for minting and evolving.
  • +43/-78 
    mock.rs
    Update mock configuration for Evolution Collection precompiles.

    precompile/evolution-collection/src/mock.rs

  • Updated mock configuration to use new precompile structure.
  • Added new type definitions for PrecompileCall and
    FactoryPrecompileCall.
  • +40/-60 
    Enhancement
    lib.rs
    Refactor Evolution Collection precompile with macros.       

    precompile/evolution-collection/src/lib.rs

  • Refactored precompile implementation to use macros.
  • Added new precompile functions for minting, evolving, and ownership
    transfer.
  • Implemented gas cost recording and error handling.
  • +211/-252
    lib.rs
    Implement legacy Evolution Collection precompile.               

    precompile/evolution-collection-legacy/src/lib.rs

  • Added new legacy precompile implementation.
  • Implemented functions for minting, evolving, and ownership transfer.
  • +374/-0 

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @asiniscalchi
    Copy link
    Member Author

    /describe

    Copy link

    PR Description updated to latest commit (5c09b38)

    @asiniscalchi
    Copy link
    Member Author

    /describe

    Copy link

    PR Description updated to latest commit (01910a7)

    @asiniscalchi asiniscalchi changed the title Feature/first precompile with macros Refactoring precompiles to use macros Jun 18, 2024
    @asiniscalchi asiniscalchi marked this pull request as ready for review June 18, 2024 10:56
    @asiniscalchi
    Copy link
    Member Author

    /describe

    Copy link

    PR Description updated to latest commit (e3fb42d)

    @asiniscalchi asiniscalchi merged commit eb8fc0e into main Jun 18, 2024
    8 checks passed
    @asiniscalchi asiniscalchi deleted the feature/first_precompile_with_macros branch June 18, 2024 13:33
    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.

    3 participants