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: PoX lock handling into separate workspace member #3793

Merged
merged 2 commits into from
Jul 28, 2023

Conversation

kantai
Copy link
Member

@kantai kantai commented Jul 14, 2023

Description

This is a refactor that moves the PoX lock handling into a separate workspace member.

This was a pretty simple set of operations to lift: they did not depend on any non-public members and the only circular dependency possibility was the use of ChainstateError in some of the methods. ChainstateError wasn't really necessary (and in some cases, was doing like a ClarityError(ChainstateError(ClarityError))) error wrapping), so this PR uses its own LockingError enum instead in those places.

The reason for this refactoring (beyond the fact that it's easy to do, and separates some complexity from the StacksChainstate struct) is to support something like my PR on the clarinet repo (hirosystems/clarinet#1074) without code duplication (i.e., the ability to evaluate the PoX locks in clarinet).

@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #3793 (51351d0) into develop (8c62f91) will decrease coverage by 0.01%.
Report is 1 commits behind head on develop.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop    #3793      +/-   ##
===========================================
- Coverage     0.18%    0.18%   -0.01%     
===========================================
  Files          301      306       +5     
  Lines       278555   278581      +26     
===========================================
  Hits           512      512              
- Misses      278043   278069      +26     
Files Changed Coverage Δ
pox-locking/src/events.rs 0.00% <0.00%> (ø)
pox-locking/src/lib.rs 0.00% <0.00%> (ø)
pox-locking/src/pox_1.rs 0.00% <0.00%> (ø)
pox-locking/src/pox_2.rs 0.00% <0.00%> (ø)
pox-locking/src/pox_3.rs 0.00% <0.00%> (ø)
src/chainstate/stacks/db/accounts.rs 0.00% <ø> (ø)
src/clarity_vm/special.rs 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kantai kantai requested a review from obycode July 19, 2023 14:10
Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

LGTM! Great idea to separate this out and use it in clarinet!

pox-locking/src/events.rs Show resolved Hide resolved
@kantai kantai merged commit 55c04d7 into develop Jul 28, 2023
1 check passed
@kantai kantai deleted the refactor/pox-lock-member branch July 28, 2023 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants