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!: add encode/decodeValueType as public callable methods #325

Merged
merged 3 commits into from
Nov 24, 2023

Conversation

CJ42
Copy link
Collaborator

@CJ42 CJ42 commented Oct 24, 2023

What kind of change does this PR introduce (bug fix, feature, docs update, ...)?

Feature

What is the current behaviour (you can also link to an open issue here)?

The methods encodeValueType and decodeValueType are currently not available as public method part of the ERC725 class.

These methods can be useful to encode certain LSP2 value type raw. For example, a uin128 (For LSP2 Array length) to obtain an exactly 16 bytes long value.

What is the new behaviour (if this is a feature change)?

Make this method part of the class, so that they can be called and used.

Other information:

src/index.ts Show resolved Hide resolved
@frozeman
Copy link
Contributor

frozeman commented Nov 7, 2023

we need to update the docs as well, when we do this change

@Hugoo
Copy link
Contributor

Hugoo commented Nov 23, 2023

Ready to merge - just waiting for conflict fix and docs update: https://github.com/ERC725Alliance/erc725.js/blob/develop/docs/classes/ERC725.md

@codecov-commenter
Copy link

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (9640d9f) 83.71% compared to head (1c6925a) 83.50%.
Report is 19 commits behind head on develop.

Files Patch % Lines
src/lib/encoder.ts 73.68% 0 Missing and 5 partials ⚠️
src/index.ts 63.63% 4 Missing ⚠️
src/lib/getDataFromExternalSources.ts 33.33% 0 Missing and 2 partials ⚠️
src/lib/utils.ts 81.81% 1 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #325      +/-   ##
===========================================
- Coverage    83.71%   83.50%   -0.21%     
===========================================
  Files           18       17       -1     
  Lines         1130     1134       +4     
  Branches       255      258       +3     
===========================================
+ Hits           946      947       +1     
+ Misses          98       97       -1     
- Partials        86       90       +4     

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

@@ -766,86 +975,6 @@ myErc725.decodeMappingKey(

---

## encodePermissions
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Hugoo this has not been deleted, just move at the top to sort function names correctly by alphabetical order.

@Hugoo Hugoo merged commit a6fe7c8 into develop Nov 24, 2023
2 checks passed
@Hugoo Hugoo deleted the feat/encodeValueType branch November 24, 2023 15:03
This was referenced May 15, 2024
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.

4 participants