Add encodeCallMsg field-context errors and logTriggerConfig helper#201
Merged
ernest-nowacki merged 4 commits intomainfrom Mar 6, 2026
Merged
Add encodeCallMsg field-context errors and logTriggerConfig helper#201ernest-nowacki merged 4 commits intomainfrom
ernest-nowacki merged 4 commits intomainfrom
Conversation
- encodeCallMsg now wraps hexToBase64 errors with field name context - Add logTriggerConfig() helper for validated hex-to-base64 log trigger config - Add validateHexByteLength for address (20 bytes) and topic (32 bytes) validation - Add 17 new tests for encodeCallMsg error context and logTriggerConfig
Contributor
Author
|
accompanying docs pr smartcontractkit/documentation#3517 |
… into reducePanics
ernest-nowacki
approved these changes
Mar 6, 2026
amit-momin
added a commit
that referenced
this pull request
Mar 31, 2026
* Bumped package.json for new chain integrations (#203) * Add ability to pre-release (#204) * Added Pharos Atlantic support * Add encodeCallMsg field-context errors and logTriggerConfig helper (#201) * Add encodeCallMsg field-context errors and logTriggerConfig helper - encodeCallMsg now wraps hexToBase64 errors with field name context - Add logTriggerConfig() helper for validated hex-to-base64 log trigger config - Add validateHexByteLength for address (20 bytes) and topic (32 bytes) validation - Add 17 new tests for encodeCallMsg error context and logTriggerConfig * fix test * fix linter --------- Co-authored-by: ernest-nowacki <ernest.nowacki@smartcontract.com> * remove node types and bun types from workflows (#199) * remove node types and bun types from workflows * Update comment * Expose console types through global and add examples that serve as test that this setup actually works * Add node modules restrictions * Add more restricted node APIs * Expose more apis through runtime * TS fixes * Fix prepare runtime * Add links to the docs * Update versions * Add node modules examples * Add documentation around workflow validation * Add tests and fixed bug caught up by the test * Set version for alpha * Restore 1.1.3 version * Simplify error messages * Alpha release 2 * Restore correct versions * Update version, add option to use user tsconfig * Small fixes * add option to do javy plugin pre-release (#207) * Merge pull request #208 from smartcontractkit/chore/bump-cl-protos Add new EVM mainnet and testnet chains * Update chain-selectors dependency (#210) * Updated chain-selectors dependency * Updated package.json version * Added hyperliquid mainnet and gnosis chiado support (#211) * Code improvements (#214) * Reproducible builds for a an OS (possibly not tied to arch) * Remove comment that wasn't needed * Fix generate chain selectors script (#216) * Updated protos submodule to point to cap-dev branch * Check types using workflow's `tsconfig` (#212) * Update ts to be checking at build time * running full-checks * Remove extra alias * Run bun-full checks with new docker support * Update actions in github workflows (#221) * Add CI to validate protos version on cap-dev branch (#217) * Added CI validation to ensure protos submodule points to cap-dev branch * Updated checkout action version * Moved validate-submodule CI to its own workflow * Moved permissions to job * Updated checkout action version --------- Co-authored-by: Ernest Nowacki <124677192+ernest-nowacki@users.noreply.github.com> Co-authored-by: De Clercq Wentzel <10665586+wentzeld@users.noreply.github.com> Co-authored-by: ernest-nowacki <ernest.nowacki@smartcontract.com> Co-authored-by: Ryan Tinianov <tinianov@live.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
encodeCallMsgnow wrapshexToBase64errors with field name context (e.g.,Invalid hex in 'to' field of CallMsg: ...)logTriggerConfig()helper for building validated log trigger configs from hex-encoded addresses and topicsvalidateHexByteLengthfor address (20 bytes) and topic (32 bytes) validationWhy
Proto
bytesfields use base64 in JSON form. Passing raw hex strings directly causes silent data corruption — hex chars get interpreted as base64, producing wrong bytes with noerror. These helpers ensure correct encoding and catch mistakes at build time.
Test plan