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

Remove singleton pattern from ethereum smart contracts setup #72

Merged
merged 3 commits into from
Jul 19, 2022

Conversation

vtleonardo
Copy link
Contributor

Scope

Implementing the singleton pattern for the setup of the Ethereum smart contracts was not a good call since it makes the unit tests way harder to setup. This PR is replacing the singleton pattern with a handlers pattern. This new pattern should make the implementation of multiple layer1 blockchains a little bit easier in the future.

TODO:
Once we start adding new layer1 patterns, we probably will need a handler for layer1 clients and move the events and tasks to their own layer sub-packages.

@github-actions github-actions bot added the go Pull requests that update Go code label Jul 15, 2022
@vtleonardo vtleonardo requested a review from a user July 15, 2022 14:55
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Some various questions/concerns before sign-off.

layer1/executor/tasks/base_task.go Outdated Show resolved Hide resolved
layer1/executor/tasks/base_task.go Show resolved Hide resolved
layer1/handlers/contracts.go Show resolved Hide resolved
layer1/handlers/contracts.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jul 18, 2022

Codecov Report

Merging #72 (67efd9f) into main (fee293c) will decrease coverage by 0.01%.
The diff coverage is 44.44%.

@@            Coverage Diff             @@
##             main      #72      +/-   ##
==========================================
- Coverage   45.62%   45.61%   -0.02%     
==========================================
  Files         214      214              
  Lines       38503    38504       +1     
==========================================
- Hits        17568    17562       -6     
- Misses      19005    19008       +3     
- Partials     1930     1934       +4     
Impacted Files Coverage Δ
layer1/executor/task_scheduler.go 1.15% <0.00%> (-0.01%) ⬇️
layer1/executor/tasks/dkg/utils/utils.go 7.69% <0.00%> (ø)
layer1/monitor/objects/event_map.go 0.00% <ø> (ø)
layer1/executor/task_manager.go 65.96% <100.00%> (ø)
badgerTrie/smt_merkle_proof.go 60.15% <0.00%> (-4.69%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fee293c...67efd9f. Read the comment docs.

@vtleonardo vtleonardo merged commit 5e6ed46 into alicenet:main Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants