Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

Commit 2d71be4

Browse files
authored
Extra Args encoding/decoding (#42)
* feat: implement EVM Extra Args V2 encoding and decoding * feat: Add SVM Extra Args V1 encoding and decoding functionality * fix: Remove unnecessary blank lines in decodeEVMExtraArgsV2 function * chore: refactor extraArgs tests to jest from vitest by keeping the 100% coverage. Add prettier and eslint * feat: add hex utility functions * refactor: introduce minimum length constants for EVM and SVM Extra Args, updating related tests and error messages
1 parent 1a655f4 commit 2d71be4

File tree

15 files changed

+1175
-1237
lines changed

15 files changed

+1175
-1237
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ dist/
99
*.tsbuildinfo
1010
bin
1111
.codegpt
12+
13+
# jest coverage
14+
coverage/

packages/ccip-svm/.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
dist/

packages/ccip-svm/.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"tabWidth": 2,
5+
"semi": false,
6+
"printWidth": 120
7+
}

packages/ccip-svm/eslint.config.js

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import js from '@eslint/js'
2+
import tseslint from '@typescript-eslint/eslint-plugin'
3+
import tsparser from '@typescript-eslint/parser'
4+
import prettier from 'eslint-plugin-prettier'
5+
import prettierConfig from 'eslint-config-prettier'
6+
7+
export default [
8+
js.configs.recommended,
9+
{
10+
files: ['**/*.{js,ts}'],
11+
languageOptions: {
12+
parser: tsparser,
13+
parserOptions: {
14+
ecmaVersion: 'latest',
15+
sourceType: 'module',
16+
},
17+
globals: {
18+
console: 'readonly',
19+
process: 'readonly',
20+
Buffer: 'readonly',
21+
__dirname: 'readonly',
22+
__filename: 'readonly',
23+
global: 'readonly',
24+
module: 'readonly',
25+
require: 'readonly',
26+
exports: 'readonly',
27+
},
28+
},
29+
plugins: {
30+
'@typescript-eslint': tseslint,
31+
prettier: prettier,
32+
},
33+
rules: {
34+
...tseslint.configs.recommended.rules,
35+
...prettierConfig.rules,
36+
'prettier/prettier': 'error',
37+
'@typescript-eslint/no-explicit-any': 'off',
38+
'@typescript-eslint/ban-ts-comment': 'off',
39+
'@typescript-eslint/no-non-null-assertion': 'off',
40+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
41+
'@typescript-eslint/explicit-module-boundary-types': 'off',
42+
},
43+
},
44+
{
45+
files: ['**/*.test.{js,ts}', '**/__tests__/**/*.{js,ts}'],
46+
languageOptions: {
47+
globals: {
48+
describe: 'readonly',
49+
it: 'readonly',
50+
test: 'readonly',
51+
expect: 'readonly',
52+
beforeEach: 'readonly',
53+
afterEach: 'readonly',
54+
beforeAll: 'readonly',
55+
afterAll: 'readonly',
56+
jest: 'readonly',
57+
},
58+
},
59+
},
60+
{
61+
ignores: [
62+
'node_modules/**',
63+
'dist/**',
64+
'coverage/**',
65+
'*.config.js',
66+
'*.config.json',
67+
],
68+
},
69+
]

packages/ccip-svm/jest.config.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"preset": "ts-jest",
3+
"testEnvironment": "node",
4+
"testMatch": [
5+
"**/__tests__/**/*.test.ts"
6+
],
7+
"collectCoverageFrom": [
8+
"src/**/*.ts",
9+
"!src/**/*.d.ts",
10+
"!src/__tests__/**/*"
11+
],
12+
"moduleFileExtensions": [
13+
"ts",
14+
"js",
15+
"json"
16+
],
17+
"transform": {
18+
"^.+\\.ts$": "ts-jest"
19+
},
20+
"workerThreads": true,
21+
"testTimeout": 180000
22+
}

0 commit comments

Comments
 (0)