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

Refactor Contract struct #1264

Merged
merged 6 commits into from
Sep 12, 2023
Merged

Conversation

Neylix
Copy link
Member

@Neylix Neylix commented Sep 8, 2023

Description

To make it easy to understand and easier to use, many things has been refactored in contract workflow

  • Worker module refactored (moving code around)
  • Add new function in ContractFactory for test which adds the seed as ownerships as it should be in relad workflow
  • Add the contract transaction in Contract struct has it is used at many places
  • Remove ContractConstants struct, now this module is mainly a helper to convert transaction to constants
  • Add new function Contract.sign_next_transaction so a Contract is responsible for it's own signature

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Neylix Neylix added smart contracts Involve smart contracts quality Improve code quality labels Sep 8, 2023
@samuelmanzanera
Copy link
Member

Nice refactor 🚀

@bchamagne bchamagne added this to the 1.3.1 milestone Sep 8, 2023
@bchamagne
Copy link
Contributor

LGTM, I'll do some functional tests monday

Copy link
Contributor

@bchamagne bchamagne left a comment

Choose a reason for hiding this comment

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

tested a few deployments:

  • contract with trigger tx
  • contract with trigger tx named
  • contract with trigger interval

all is OK

@Neylix Neylix merged commit 41a0b6d into archethic-foundation:develop Sep 12, 2023
@Neylix Neylix deleted the Add-contract-seed branch September 12, 2023 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quality Improve code quality smart contracts Involve smart contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants