diff --git a/.github/workflows/typescript-lint.yml b/.github/workflows/typescript-lint.yml index 330bbcf7..7cdc326b 100644 --- a/.github/workflows/typescript-lint.yml +++ b/.github/workflows/typescript-lint.yml @@ -1,10 +1,16 @@ name: Cargo lint and test on: - push: - branches: [ main ] - # pull_request: - # branches: [ main ] + push + +env: + # Not needed in CI, should make things a bit faster + CARGO_INCREMENTAL: 0 + CARGO_TERM_COLOR: always + # Remove unnecessary WASM build artifacts + WASM_BUILD_CLEAN_TARGET: 1 + # stripping symbols and optimizing for binary size + RUSTFLAGS: -C strip=symbols -C opt-level=s jobs: lint-and-test: @@ -48,4 +54,4 @@ jobs: - run: pnpm install - run: pnpm lint - - run: pnpm test:cargo + - run: cargo test --release --features no-entrypoint -- --nocapture diff --git a/package.json b/package.json index b5b322c8..91a69b73 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "test:cargo": "cargo test --features no-entrypoint -- --nocapture", "test": "pnpm test:cargo && pnpm test:bankrun && pnpm test:validator", "cli": "ts-node ./packages/validator-bonds-cli/src/", - "lint:cargo": "cargo fmt -- --check && cargo clippy", + "lint:cargo": "cargo fmt -- --check && cargo clippy --release", "lint:cargo-fix": "cargo fmt --all && cargo clippy --fix --allow-staged --allow-dirty", "lint:ts": "gts lint", "lint:ts-fix": "gts fix", @@ -28,7 +28,7 @@ "@types/bn.js": "^5.1.5", "@types/jest": "^29.5.12", "@types/node": "^18.19.24", - "gts": "^5.2.0", + "gts": "^5.3.0", "jest": "^29.7.0", "ts-jest": "^29.1.2", "ts-node": "^10.9.2", diff --git a/packages/validator-bonds-sdk/src/orchestrators/orchestrateWithdrawRequest.ts b/packages/validator-bonds-sdk/src/orchestrators/orchestrateWithdrawRequest.ts index 5456f4df..942ca75a 100644 --- a/packages/validator-bonds-sdk/src/orchestrators/orchestrateWithdrawRequest.ts +++ b/packages/validator-bonds-sdk/src/orchestrators/orchestrateWithdrawRequest.ts @@ -121,8 +121,8 @@ export async function orchestrateWithdrawDeposit({ x.account.lamports > y.account.lamports ? 1 : x.account.lamports < y.account.lamports - ? -1 - : 0 + ? -1 + : 0 ) .reduce<{ stakesAmount: BN diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7be23e78..488fdff4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,8 +24,8 @@ importers: specifier: ^18.19.24 version: 18.19.24 gts: - specifier: ^5.2.0 - version: 5.2.0(typescript@5.1.6) + specifier: ^5.3.0 + version: 5.3.0(typescript@5.1.6) jest: specifier: ^29.7.0 version: 29.7.0(@types/node@18.19.24)(ts-node@10.9.2(@types/node@18.19.24)(typescript@5.1.6)) @@ -437,13 +437,14 @@ packages: resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@eslint/js@8.50.0': - resolution: {integrity: sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==} + '@eslint/js@8.53.0': + resolution: {integrity: sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} @@ -451,6 +452,7 @@ packages: '@humanwhocodes/object-schema@2.0.2': resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} + deprecated: Use @eslint/object-schema instead '@istanbuljs/load-nyc-config@1.1.0': resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} @@ -974,6 +976,9 @@ packages: resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@ungap/structured-clone@1.2.0': + resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + JSONStream@1.3.5: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} hasBin: true @@ -1390,8 +1395,8 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - eslint-config-prettier@9.0.0: - resolution: {integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==} + eslint-config-prettier@9.1.0: + resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} hasBin: true peerDependencies: eslint: '>=7.0.0' @@ -1408,8 +1413,8 @@ packages: peerDependencies: eslint: '>=5.16.0' - eslint-plugin-prettier@5.0.0: - resolution: {integrity: sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==} + eslint-plugin-prettier@5.1.3: + resolution: {integrity: sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: '@types/eslint': '>=8.0.0' @@ -1442,8 +1447,8 @@ packages: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint@8.50.0: - resolution: {integrity: sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==} + eslint@8.53.0: + resolution: {integrity: sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true @@ -1641,8 +1646,8 @@ packages: graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - gts@5.2.0: - resolution: {integrity: sha512-25qOnePUUX7upFc4ycqWersDBq+o1X6hXUTW56JOWCxPYKJXQ1RWzqT9q+2SU3LfPKJf+4sz4Dw3VT0p96Kv6g==} + gts@5.3.0: + resolution: {integrity: sha512-/V0nbaWLBv8g0v2kol5M7Vf+kHXk19Ew5sa3wQJXeUaccesXg7AFo7eEInoIpR+aIJ3QDjoYt4zHYeFr8w8rng==} engines: {node: '>=14'} hasBin: true peerDependencies: @@ -2271,8 +2276,8 @@ packages: resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} engines: {node: '>=6.0.0'} - prettier@3.0.3: - resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} + prettier@3.1.1: + resolution: {integrity: sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==} engines: {node: '>=14'} hasBin: true @@ -2386,6 +2391,7 @@ packages: rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rpc-websockets@7.9.0: @@ -3135,9 +3141,9 @@ snapshots: dependencies: '@jridgewell/trace-mapping': 0.3.9 - '@eslint-community/eslint-utils@4.4.0(eslint@8.50.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@8.53.0)': dependencies: - eslint: 8.50.0 + eslint: 8.53.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.10.0': {} @@ -3156,7 +3162,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@8.50.0': {} + '@eslint/js@8.53.0': {} '@humanwhocodes/config-array@0.11.14': dependencies: @@ -3840,15 +3846,15 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.50.0)(typescript@5.1.6))(eslint@8.50.0)(typescript@5.1.6)': + '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.53.0)(typescript@5.1.6))(eslint@8.53.0)(typescript@5.1.6)': dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 5.62.0(eslint@8.50.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.62.0(eslint@8.53.0)(typescript@5.1.6) '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.50.0)(typescript@5.1.6) - '@typescript-eslint/utils': 5.62.0(eslint@8.50.0)(typescript@5.1.6) + '@typescript-eslint/type-utils': 5.62.0(eslint@8.53.0)(typescript@5.1.6) + '@typescript-eslint/utils': 5.62.0(eslint@8.53.0)(typescript@5.1.6) debug: 4.3.4 - eslint: 8.50.0 + eslint: 8.53.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare-lite: 1.4.0 @@ -3859,13 +3865,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@5.62.0(eslint@8.50.0)(typescript@5.1.6)': + '@typescript-eslint/parser@5.62.0(eslint@8.53.0)(typescript@5.1.6)': dependencies: '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) debug: 4.3.4 - eslint: 8.50.0 + eslint: 8.53.0 optionalDependencies: typescript: 5.1.6 transitivePeerDependencies: @@ -3876,12 +3882,12 @@ snapshots: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - '@typescript-eslint/type-utils@5.62.0(eslint@8.50.0)(typescript@5.1.6)': + '@typescript-eslint/type-utils@5.62.0(eslint@8.53.0)(typescript@5.1.6)': dependencies: '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) - '@typescript-eslint/utils': 5.62.0(eslint@8.50.0)(typescript@5.1.6) + '@typescript-eslint/utils': 5.62.0(eslint@8.53.0)(typescript@5.1.6) debug: 4.3.4 - eslint: 8.50.0 + eslint: 8.53.0 tsutils: 3.21.0(typescript@5.1.6) optionalDependencies: typescript: 5.1.6 @@ -3904,15 +3910,15 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@5.62.0(eslint@8.50.0)(typescript@5.1.6)': + '@typescript-eslint/utils@5.62.0(eslint@8.53.0)(typescript@5.1.6)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.50.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.53.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.7 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) - eslint: 8.50.0 + eslint: 8.53.0 eslint-scope: 5.1.1 semver: 7.6.0 transitivePeerDependencies: @@ -3924,6 +3930,8 @@ snapshots: '@typescript-eslint/types': 5.62.0 eslint-visitor-keys: 3.4.3 + '@ungap/structured-clone@1.2.0': {} + JSONStream@1.3.5: dependencies: jsonparse: 1.3.1 @@ -4318,34 +4326,34 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-config-prettier@9.0.0(eslint@8.50.0): + eslint-config-prettier@9.1.0(eslint@8.53.0): dependencies: - eslint: 8.50.0 + eslint: 8.53.0 - eslint-plugin-es@3.0.1(eslint@8.50.0): + eslint-plugin-es@3.0.1(eslint@8.53.0): dependencies: - eslint: 8.50.0 + eslint: 8.53.0 eslint-utils: 2.1.0 regexpp: 3.2.0 - eslint-plugin-node@11.1.0(eslint@8.50.0): + eslint-plugin-node@11.1.0(eslint@8.53.0): dependencies: - eslint: 8.50.0 - eslint-plugin-es: 3.0.1(eslint@8.50.0) + eslint: 8.53.0 + eslint-plugin-es: 3.0.1(eslint@8.53.0) eslint-utils: 2.1.0 ignore: 5.3.1 minimatch: 3.1.2 resolve: 1.22.8 semver: 6.3.1 - eslint-plugin-prettier@5.0.0(eslint-config-prettier@9.0.0(eslint@8.50.0))(eslint@8.50.0)(prettier@3.0.3): + eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0(eslint@8.53.0))(eslint@8.53.0)(prettier@3.1.1): dependencies: - eslint: 8.50.0 - prettier: 3.0.3 + eslint: 8.53.0 + prettier: 3.1.1 prettier-linter-helpers: 1.0.0 synckit: 0.8.8 optionalDependencies: - eslint-config-prettier: 9.0.0(eslint@8.50.0) + eslint-config-prettier: 9.1.0(eslint@8.53.0) eslint-scope@5.1.1: dependencies: @@ -4365,15 +4373,16 @@ snapshots: eslint-visitor-keys@3.4.3: {} - eslint@8.50.0: + eslint@8.53.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.50.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.53.0) '@eslint-community/regexpp': 4.10.0 '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.50.0 + '@eslint/js': 8.53.0 '@humanwhocodes/config-array': 0.11.14 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 @@ -4588,21 +4597,21 @@ snapshots: graphemer@1.4.0: {} - gts@5.2.0(typescript@5.1.6): + gts@5.3.0(typescript@5.1.6): dependencies: - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.50.0)(typescript@5.1.6))(eslint@8.50.0)(typescript@5.1.6) - '@typescript-eslint/parser': 5.62.0(eslint@8.50.0)(typescript@5.1.6) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.53.0)(typescript@5.1.6))(eslint@8.53.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.62.0(eslint@8.53.0)(typescript@5.1.6) chalk: 4.1.2 - eslint: 8.50.0 - eslint-config-prettier: 9.0.0(eslint@8.50.0) - eslint-plugin-node: 11.1.0(eslint@8.50.0) - eslint-plugin-prettier: 5.0.0(eslint-config-prettier@9.0.0(eslint@8.50.0))(eslint@8.50.0)(prettier@3.0.3) + eslint: 8.53.0 + eslint-config-prettier: 9.1.0(eslint@8.53.0) + eslint-plugin-node: 11.1.0(eslint@8.53.0) + eslint-plugin-prettier: 5.1.3(eslint-config-prettier@9.1.0(eslint@8.53.0))(eslint@8.53.0)(prettier@3.1.1) execa: 5.1.1 inquirer: 7.3.3 json5: 2.2.3 meow: 9.0.0 ncp: 2.0.0 - prettier: 3.0.3 + prettier: 3.1.1 rimraf: 3.0.2 typescript: 5.1.6 write-file-atomic: 4.0.2 @@ -5411,7 +5420,7 @@ snapshots: dependencies: fast-diff: 1.3.0 - prettier@3.0.3: {} + prettier@3.1.1: {} pretty-format@29.7.0: dependencies: