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(store): restore bytesN helpers #2403

Merged
merged 8 commits into from
Mar 11, 2024
Merged

fix(store): restore bytesN helpers #2403

merged 8 commits into from
Mar 11, 2024

Conversation

holic
Copy link
Member

@holic holic commented Mar 10, 2024

These were removed in #2090 as part of audit fixes because they appeared unused, but we missed that they are used by codegen (likely because the function signature is generated by a template string):

const innerSlice = `Bytes.slice${staticByteLength}(_blob, ${offset})`;

Shoutout to @transmissions11 for spotting this and kicking this off in #2402

While I was here, I renamed the helpers from Bytes.sliceN to Bytes.getBytesN to both match the Bytes.setBytesN methods and to better differentiate this from Slice and SliceLib utils.

Copy link

changeset-bot bot commented Mar 10, 2024

🦋 Changeset detected

Latest commit: b836ed6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 31 packages
Name Type
@latticexyz/store Patch
@latticexyz/cli Patch
@latticexyz/dev-tools Patch
@latticexyz/react Patch
@latticexyz/store-indexer Patch
@latticexyz/store-sync Patch
@latticexyz/world-modules Patch
@latticexyz/world Patch
@latticexyz/abi-ts Patch
@latticexyz/block-logs-stream Patch
@latticexyz/common Patch
@latticexyz/config Patch
create-mud Patch
@latticexyz/ecs-browser Patch
@latticexyz/faucet Patch
@latticexyz/gas-report Patch
@latticexyz/network Patch
@latticexyz/noise Patch
@latticexyz/phaserx Patch
@latticexyz/protocol-parser Patch
@latticexyz/recs Patch
@latticexyz/schema-type Patch
@latticexyz/services Patch
@latticexyz/solecs Patch
solhint-config-mud Patch
solhint-plugin-mud Patch
@latticexyz/std-client Patch
@latticexyz/std-contracts Patch
@latticexyz/store-cache Patch
@latticexyz/utils Patch
mock-game-contracts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@holic holic changed the title feat(store): restore bytes helpers feat(store): restore bytesN helpers Mar 10, 2024
@holic holic marked this pull request as ready for review March 10, 2024 11:01
@holic holic requested review from alvrs and yonadaa as code owners March 10, 2024 11:01
@holic holic changed the title feat(store): restore bytesN helpers fix(store): restore bytesN helpers Mar 10, 2024
Copy link
Contributor

@yonadaa yonadaa left a comment

Choose a reason for hiding this comment

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

Great spot! I wish there was a way we could not get the compiler warning

@holic holic merged commit 190fdd1 into main Mar 11, 2024
11 checks passed
@holic holic deleted the holic/restore-bytes-helpers branch March 11, 2024 10:26
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.

3 participants