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

Consolidate poxAddress type #1508

Open
friedger opened this issue Jun 20, 2023 · 3 comments
Open

Consolidate poxAddress type #1508

friedger opened this issue Jun 20, 2023 · 3 comments
Assignees
Labels
feature Brand new functionality. New pages, workflows, endpoints, etc.

Comments

@friedger
Copy link
Collaborator

Problem

extractPoxAddressFromClarityValue and DelegationInfo define different poxAddress types

Type error like the one below happen when using DelegationInfo and the result of extractPoxAddressFromClarityValue:
Type '{ version: number; hashBytes: Uint8Array; } | undefined' is not assignable to type '{ version: Uint8Array; hashbytes: Uint8Array; } | undefined'.

Solution

Define type PoxAddress as { version: number; hashBytes: Uint8Array; } and use it everywhere.

Alternatives

  • write another extractPoxAddressFromClarityValue2 function that returns a different type - that will confuse developers even more
  • define type PoxAddress as { version: Uint8Array; hashbytes: Uint8Array; } - Btc addresses use type number for version, therefore PoxAddress should adopt type number as well. PoXAddressVersion uses number as well.
@friedger friedger added the feature Brand new functionality. New pages, workflows, endpoints, etc. label Jun 20, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in DevTools Jun 20, 2023
@janniks
Copy link
Collaborator

janniks commented Jun 20, 2023

Will do. I wholeheartedly agree 🙏🏻

@janniks janniks self-assigned this Jun 21, 2023
@janniks janniks moved this from 🆕 New to 🔖 To do in DevTools Jun 21, 2023
@janniks janniks moved this from 🔖 To do to 🏗 In progress in DevTools Jun 22, 2023
@smcclellan smcclellan moved this from 🏗 In Progress to 🚢 Ready to Release in DevTools Jul 25, 2023
@smcclellan
Copy link
Contributor

This work is complete. It will be released when we do a next major version release.

@smcclellan smcclellan added this to the Q3-2023 milestone Jul 31, 2023
@smcclellan smcclellan modified the milestones: Q3-2023, Q4-2023 Sep 14, 2023
@andresgalante
Copy link
Member

@janniks has this been released? if so lets close this issue

@andresgalante andresgalante moved this from 🚢 Ready to Release to ✅ Done in DevTools Nov 13, 2023
@smcclellan smcclellan modified the milestones: Q4-2023, Q1-2024 Jan 16, 2024
@smcclellan smcclellan removed this from the Q1-2024 milestone Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Brand new functionality. New pages, workflows, endpoints, etc.
Projects
Archived in project
Development

No branches or pull requests

4 participants