Skip to content

eth/abi: implement packed encoder#310

Merged
q9f merged 7 commits intomainfrom
q9f/abi/packed2
Jan 3, 2025
Merged

eth/abi: implement packed encoder#310
q9f merged 7 commits intomainfrom
q9f/abi/packed2

Conversation

@q9f
Copy link
Owner

@q9f q9f commented Jan 2, 2025

fix #103

replace #211

types = ["int16", "bytes1", "uint16", "string"]
values = [
  -1, "\B", 0x03, "Hello, world!",
]
Abi.solidity_packed(types, values)
# => "ffff42000348656c6c6f2c20776f726c6421"

ref https://docs.soliditylang.org/en/v0.8.28/abi-spec.html#non-standard-packed-mode

@q9f q9f added the enhancement New feature or request label Jan 2, 2025
@codecov
Copy link

codecov bot commented Jan 2, 2025

Codecov Report

Attention: Patch coverage is 98.04560% with 6 lines in your changes missing coverage. Please review.

Project coverage is 99.53%. Comparing base (633c25d) to head (190f65c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
spec/eth/abi_spec.rb 69.23% 4 Missing ⚠️
lib/eth/abi/packed/encoder.rb 97.56% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #310      +/-   ##
==========================================
- Coverage   99.63%   99.53%   -0.10%     
==========================================
  Files          77       79       +2     
  Lines        4650     4943     +293     
==========================================
+ Hits         4633     4920     +287     
- Misses         17       23       +6     

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

@q9f q9f merged commit 8a7e9e9 into main Jan 3, 2025
@q9f q9f deleted the q9f/abi/packed2 branch January 3, 2025 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eth/abi: implement encode_packed/decode_packed

1 participant