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

fix: allow more than one Rosetta stx_unlock operation per block #1712

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

zone117x
Copy link
Member

Only a single stx_unlock Rosetta operation is being returned per block, even when multiple unlocks occur in a block.

Here are two examples that should include a stx_unlock operation for address SPVEW3RAESA4A4TG5R81A5D06MBMGV3EP0KABEXK, but do not and only contain a single stx_unlock for another address:

# Get the unlock associated with https://explorer.hiro.so/txid/0x2d8ad4db2d114d89f0e105908bb6af77016cc9c2582921651e70f40dc327de60?chain=mainnet
curl -X POST https://api.mainnet.hiro.so/rosetta/v1/block -H 'Content-Type: application/json' -d '{"network_identifier":{"blockchain":"stacks","network":"mainnet"},"block_identifier":{"index": 110979}}'
# Get the unlock associated with https://explorer.hiro.so/txid/0x41621da710b4c7554983dc06b38e28b61f333676c5c1fb385d291f63f0051619?chain=mainnet
curl -X POST https://api.mainnet.hiro.so/rosetta/v1/block -H 'Content-Type: application/json' -d '{"network_identifier":{"blockchain":"stacks","network":"mainnet"},"block_identifier":{"index": 120101}}'

@vercel
Copy link

vercel bot commented Sep 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
stacks-blockchain-api ❌ Failed (Inspect) Sep 11, 2023 2:38pm

@github-actions
Copy link

@github-actions github-actions bot temporarily deployed to pull request September 11, 2023 14:40 Inactive
@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #1712 (c8392c8) into master (1250324) will increase coverage by 0.05%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1712      +/-   ##
==========================================
+ Coverage   76.72%   76.77%   +0.05%     
==========================================
  Files          80       80              
  Lines       11503    11503              
  Branches     2574     2574              
==========================================
+ Hits         8826     8832       +6     
+ Misses       2548     2541       -7     
- Partials      129      130       +1     
Files Changed Coverage Δ
src/datastore/pg-store.ts 90.41% <ø> (+0.17%) ⬆️

... and 3 files with indirect coverage changes

@zone117x
Copy link
Member Author

This seems to have fixed the issue. Testing against our dev env:

curl -X POST https://api.dev.hiro.so/rosetta/v1/block -H 'Content-Type: application/json' -d \
'{"network_identifier":{"blockchain":"stacks","network":"mainnet"},"block_identifier":{"index": 120101}}' \
| grep -B4 -A8 SPVEW3RAESA4A4TG5R81A5D06MBMGV3EP0KABEXK

            "type": "stx_unlock",
            "status": "success",
            "account": {
              "address": "SPVEW3RAESA4A4TG5R81A5D06MBMGV3EP0KABEXK"
            },
            "amount": {
              "value": "699998000000",
              "currency": {
                "decimals": 6,
                "symbol": "STX"
              }
            },

Copy link
Collaborator

@rafaelcr rafaelcr left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @zone117x

@zone117x zone117x merged commit 81221c8 into master Sep 11, 2023
33 checks passed
@zone117x zone117x deleted the hotfix/rosetta-stx-unlock branch September 11, 2023 16:00
blockstack-devops pushed a commit that referenced this pull request Sep 11, 2023
## [7.3.1](v7.3.0...v7.3.1) (2023-09-11)

### Bug Fixes

* allow more than one Rosetta `stx_unlock` operation per block ([#1712](#1712)) ([81221c8](81221c8))
@blockstack-devops
Copy link

🎉 This PR is included in version 7.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants