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!: Make serialize methods return hex-encoded strings, instead of bytes #1657

Conversation

janniks
Copy link
Collaborator

@janniks janniks commented Mar 11, 2024

Make serialize methods return hex-encoded strings, instead of bytes

Reasoning: Most people shouldn't need to know what buffers/bytes are, they know hex from seeing strings around though. They expect txs, keys, etc. to be a hex string.

Also, renames AssetInfo to Asset for less confusion. With more strongly typed strings.

Closes #1655

Migration

- const bytes = serializePostCondition(pc);
+ const bytes = serializePostConditionBytes(pc);

New behavior

const hexString = serializePostCondition(pc);

Copy link

vercel bot commented Mar 11, 2024

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

Name Status Preview Comments Updated (UTC)
stacksjs-docs ❌ Failed (Inspect) Jun 10, 2024 0:25am

@janniks janniks mentioned this pull request Mar 11, 2024
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 82.30088% with 40 lines in your changes missing coverage. Please review.

Project coverage is 66.37%. Comparing base (922e037) to head (b3d3921).
Report is 53 commits behind head on next.

Current head b3d3921 differs from pull request most recent head faae503

Please upload reports for the commit faae503 to get more accurate results.

Files Patch % Lines
packages/transactions/src/types.ts 71.05% 33 Missing ⚠️
packages/transactions/src/signature.ts 75.00% 4 Missing ⚠️
packages/transactions/src/keys.ts 66.66% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1657      +/-   ##
==========================================
- Coverage   66.37%   66.37%   -0.01%     
==========================================
  Files         119      124       +5     
  Lines        8717     8871     +154     
  Branches     1920     1979      +59     
==========================================
+ Hits         5786     5888     +102     
+ Misses       2806     2743      -63     
- Partials      125      240     +115     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@janniks janniks force-pushed the 03-11-feat_Make_serialize_methods_return_hex-encoded_strings_instead_of_bytes branch from 9774ab0 to 010a58b Compare March 12, 2024 00:18
@janniks janniks force-pushed the 03-11-feat_Make_serialize_methods_return_hex-encoded_strings_instead_of_bytes branch from 010a58b to 9d33d90 Compare March 12, 2024 01:33
@janniks janniks force-pushed the 03-11-feat_Make_serialize_methods_return_hex-encoded_strings_instead_of_bytes branch from 9d33d90 to 6a1fff8 Compare March 12, 2024 12:58
@janniks janniks force-pushed the 03-11-feat_Make_serialize_methods_return_hex-encoded_strings_instead_of_bytes branch from 6a1fff8 to 9cf6017 Compare March 12, 2024 13:17
@janniks janniks force-pushed the 03-11-feat_Make_serialize_methods_return_hex-encoded_strings_instead_of_bytes branch from 9cf6017 to 64e29f8 Compare March 12, 2024 13:31
@janniks janniks marked this pull request as draft March 12, 2024 14:59
@janniks janniks force-pushed the 03-11-feat_Make_serialize_methods_return_hex-encoded_strings_instead_of_bytes branch from 64e29f8 to 016113a Compare March 18, 2024 22:15
@janniks janniks force-pushed the 03-11-feat_Make_serialize_methods_return_hex-encoded_strings_instead_of_bytes branch from 016113a to 64956fe Compare March 18, 2024 22:17
@janniks janniks force-pushed the 03-11-feat_Make_serialize_methods_return_hex-encoded_strings_instead_of_bytes branch from 64956fe to d5b022c Compare April 24, 2024 12:29
@janniks janniks force-pushed the 03-11-feat_Make_serialize_methods_return_hex-encoded_strings_instead_of_bytes branch from d5b022c to 9d97081 Compare April 25, 2024 10:00
@janniks janniks force-pushed the 03-11-feat_Make_serialize_methods_return_hex-encoded_strings_instead_of_bytes branch from 9d97081 to 7dfd402 Compare April 25, 2024 10:47
@janniks janniks force-pushed the 03-11-feat_Make_serialize_methods_return_hex-encoded_strings_instead_of_bytes branch from 7dfd402 to 4e8551b Compare April 25, 2024 11:57
@janniks janniks marked this pull request as ready for review April 25, 2024 12:01
@janniks janniks requested a review from MicaiahReid May 28, 2024 00:17
Copy link
Contributor

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@hugocaillard hugocaillard left a comment

Choose a reason for hiding this comment

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

LGTM @janniks 👏

Base automatically changed from 03-11-fix_update_cli to next June 10, 2024 11:43
@janniks janniks force-pushed the 03-11-feat_Make_serialize_methods_return_hex-encoded_strings_instead_of_bytes branch from b3d3921 to faae503 Compare June 10, 2024 12:24
@janniks janniks merged commit a189ec0 into next Jun 10, 2024
7 of 9 checks passed
@janniks janniks deleted the 03-11-feat_Make_serialize_methods_return_hex-encoded_strings_instead_of_bytes branch June 10, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants