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

Withdrawal entry RPC and fixes #116

Merged
merged 5 commits into from
Jun 29, 2022
Merged

Withdrawal entry RPC and fixes #116

merged 5 commits into from
Jun 29, 2022

Conversation

kantai
Copy link
Contributor

@kantai kantai commented Jun 10, 2022

This PR:

  1. Adds a new RPC endpoint, documented in the OpenAPI spec, for retrieving withdrawal information from the withdrawal merkle tree
  2. Adds the withdrawal_id to withdrawal events (Record withdrawal_id in withdrawal events #115)
  3. Fixes a bug in the deposit STX handler: depositing STX should increase the liquid STX supply, if it doesn't, the withdrawals can cause a panic.
  4. Adds test coverage for the withdrawal events and withdrawal RPC interface
  5. Simplifies the RunTenure directive in the neon_node: the miner always mines off of the burnchain tip when it receives a directive, so it does not need to be passed via the directive channel.

@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2022

Codecov Report

Merging #116 (6328b97) into master (ccff7ca) will increase coverage by 0.13%.
The diff coverage is 84.22%.

@@            Coverage Diff             @@
##           master     #116      +/-   ##
==========================================
+ Coverage   78.09%   78.23%   +0.13%     
==========================================
  Files         261      262       +1     
  Lines      171195   171344     +149     
==========================================
+ Hits       133696   134050     +354     
+ Misses      37499    37294     -205     
Impacted Files Coverage Δ
src/burnchains/mod.rs 43.93% <ø> (ø)
...net/stacks-node/src/burnchains/tests/db_indexer.rs 100.00% <ø> (ø)
testnet/stacks-node/src/main.rs 0.74% <0.00%> (+0.03%) ⬆️
testnet/stacks-node/src/run_loop/mod.rs 9.85% <ø> (-0.27%) ⬇️
testnet/stacks-node/src/config.rs 34.31% <36.84%> (+3.84%) ⬆️
src/burnchains/burnchain.rs 70.15% <41.66%> (-1.11%) ⬇️
clarity/src/vm/events.rs 36.40% <45.45%> (+5.19%) ⬆️
src/net/http.rs 70.21% <67.30%> (-0.05%) ⬇️
testnet/stacks-node/src/neon_node.rs 76.53% <67.50%> (+0.32%) ⬆️
src/net/rpc.rs 18.21% <80.14%> (+1.91%) ⬆️
... and 45 more

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 ab57869...6328b97. Read the comment docs.

Copy link
Contributor

@pavitthrap pavitthrap left a comment

Choose a reason for hiding this comment

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

lgtm!

Comment on lines +46 to +47
node ./publish_tx.js ft-trait-standard ../contracts/ft-trait-standard.clar 0 > ../transactions/ft-publish.hex
node ./publish_tx.js nft-trait-standard ../contracts/nft-trait-standard.clar 1 > ../transactions/nft-publish.hex
Copy link
Contributor

Choose a reason for hiding this comment

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

when my nft use case integration test pr merges, I'll update these instructions

@@ -339,6 +342,7 @@ impl NFTWithdrawEventData {
"sender": format!("{}",self.sender),
"value": self.value,
"raw_value": format!("0x{}", raw_value.join("")),
"withdrawal_id": self.withdrawal_id.unwrap_or(0),
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if it makes sense to default to 0 in these serializations here (since 0 is a valid id)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched these methods in 30cca56 to return Options, so that the caller can choose to either error or panic.

@kantai kantai linked an issue Jun 28, 2022 that may be closed by this pull request
@kantai kantai changed the base branch from feat/drop-first-burn-hash to master June 28, 2022 18:48
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.

Record withdrawal_id in withdrawal events
3 participants