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

Feat/synthetic print delegate stx #3503

Merged
merged 10 commits into from
Jan 24, 2023
Merged

Conversation

pavitthrap
Copy link
Contributor

Description

This PR adds a synthetic print event to the delegate-stx function in the pox-2 contract. It does so by means of the special contract handler (defined in special.rs).

This PR adds 2 tests:

  • a test in pox_2_tests.rs that called delegate-stx through a normal stacks transaction
  • a test in neon_integrations.rs that sends a btc wire DelegateStx tx, and verifies (a) that the delegation was successful, and (b) that a synthetic print event was emitted.

Applicable issues

Additional info (benefits, drawbacks, caveats)

Checklist

  • Test coverage for new or modified code paths
  • Changelog is updated
  • Required documentation changes (e.g., docs/rpc/openapi.yaml and rpc-endpoints.md for v2 endpoints, event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo
  • New integration test(s) added to bitcoin-tests.yml

@pavitthrap pavitthrap requested review from kantai and obycode January 18, 2023 22:35
@codecov
Copy link

codecov bot commented Jan 18, 2023

Codecov Report

Merging #3503 (149ae7f) into develop (d89fbb2) will increase coverage by 30.86%.
The diff coverage is 84.57%.

@@             Coverage Diff              @@
##           develop    #3503       +/-   ##
============================================
+ Coverage     0.18%   31.05%   +30.86%     
============================================
  Files          298      298               
  Lines       271851   272236      +385     
============================================
+ Hits           512    84549    +84037     
+ Misses      271339   187687    -83652     
Impacted Files Coverage Δ
src/chainstate/stacks/boot/pox_2_tests.rs 0.00% <0.00%> (ø)
src/chainstate/stacks/db/blocks.rs 33.45% <0.00%> (+33.45%) ⬆️
...-node/src/burnchains/bitcoin_regtest_controller.rs 86.21% <73.07%> (+86.21%) ⬆️
testnet/stacks-node/src/tests/neon_integrations.rs 87.34% <98.78%> (+87.34%) ⬆️
src/clarity_vm/special.rs 55.73% <100.00%> (+55.73%) ⬆️
testnet/stacks-node/src/main.rs 0.54% <0.00%> (+0.54%) ⬆️
testnet/stacks-node/src/stacks_events.rs 1.29% <0.00%> (+1.29%) ⬆️
src/clarity_cli.rs 1.52% <0.00%> (+1.52%) ⬆️
clarity/src/vm/functions/crypto.rs 5.12% <0.00%> (+5.12%) ⬆️
... and 209 more

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

@zone117x
Copy link
Member

Hey @pavitthrap I'm trying to test out this branch and running into this build error:

error[E0599]: no method named `build_delegate_stacks_tx` found for mutable reference `&mut BitcoinRegtestController` in the current scope
    --> testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs:1771:22
     |
1771 |                 self.build_delegate_stacks_tx(epoch_id, payload, op_signer, None)
     |                      ^^^^^^^^^^^^^^^^^^^^^^^^ help: there is a method with a similar name: `build_pre_stacks_tx`

@pavitthrap
Copy link
Contributor Author

Hey @pavitthrap I'm trying to test out this branch and running into this build error:

error[E0599]: no method named `build_delegate_stacks_tx` found for mutable reference `&mut BitcoinRegtestController` in the current scope
    --> testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs:1771:22
     |
1771 |                 self.build_delegate_stacks_tx(epoch_id, payload, op_signer, None)
     |                      ^^^^^^^^^^^^^^^^^^^^^^^^ help: there is a method with a similar name: `build_pre_stacks_tx`

Just fixed the non-test build!

Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

This LGTM as long as @zone117x and @lgalabru are able to confirm that the event observer receives the requisite data. Thanks for tackling this!

Copy link
Member

@zone117x zone117x left a comment

Choose a reason for hiding this comment

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

Tested and working as expected at hirosystems/stacks-blockchain-api#1527

Thanks @pavitthrap!

@blockstack-devops
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Nov 14, 2024
@wileyj wileyj deleted the feat/synthetic-print-delegate-stx branch March 11, 2025 21:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants