From 9e64dd78b4677f3753d442de17ab8d0947d81e1d Mon Sep 17 00:00:00 2001 From: Manos Liolios Date: Wed, 11 Mar 2026 15:22:43 +0200 Subject: [PATCH 1/2] bump sui bin and fix a test --- sdk/package.json | 4 ++-- sdk/pas/test/e2e/e2e.isolated.test.ts | 17 +++----------- sdk/pas/test/e2e/globalSetup.ts | 4 ++-- sdk/pnpm-lock.yaml | 32 ++++++++++++++++++++++++--- 4 files changed, 36 insertions(+), 21 deletions(-) diff --git a/sdk/package.json b/sdk/package.json index 76992f8..acc5f11 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -10,12 +10,12 @@ "author": "Mysten Labs", "license": "Apache-2.0", "devDependencies": { - "@mysten/sui": "^2.4.0", + "@mysten/sui": "^2.6.0", "@mysten/bcs": "^2.0.2", "@mysten/codegen": "^0.6.0" }, "peerDependencies": { - "@mysten/sui": "^2.4.0", + "@mysten/sui": "^2.6.0", "@mysten/bcs": "^2.0.2" } } diff --git a/sdk/pas/test/e2e/e2e.isolated.test.ts b/sdk/pas/test/e2e/e2e.isolated.test.ts index dde94b3..b87afd8 100644 --- a/sdk/pas/test/e2e/e2e.isolated.test.ts +++ b/sdk/pas/test/e2e/e2e.isolated.test.ts @@ -3,7 +3,7 @@ import { normalizeStructTag, normalizeSuiAddress } from '@mysten/sui/utils'; import { describe, expect, it } from 'vitest'; import { DemoUsdTestHelpers } from './demoUsd.ts'; -import { setupToolbox, simulateFailingTransaction, type TestToolbox } from './setup.ts'; +import { executeTransaction, setupToolbox, simulateFailingTransaction, type TestToolbox } from './setup.ts'; async function expectBalances( toolbox: TestToolbox, @@ -336,19 +336,8 @@ describe.concurrent( assetType: demoUsd.demoUsdAssetType, }), ); - - const resp = await toolbox.client.signAndExecuteTransaction({ - signer: toolbox.keypair, - transaction, - include: { - effects: true, - }, - }); - - expect(resp.FailedTransaction).toBeDefined(); - expect(resp.FailedTransaction!.effects.status.error!.message).toEqual( - 'InsufficientFundsForWithdraw', - ); + + expect(executeTransaction(toolbox, transaction)).rejects.toThrowError('InsufficientFundsForWithdraw'); }); it('use_v2 upgrades approval logic and the resolver picks up the new template', async () => { diff --git a/sdk/pas/test/e2e/globalSetup.ts b/sdk/pas/test/e2e/globalSetup.ts index 04c30cd..f5094c6 100644 --- a/sdk/pas/test/e2e/globalSetup.ts +++ b/sdk/pas/test/e2e/globalSetup.ts @@ -17,8 +17,8 @@ declare module 'vitest' { const SUI_TOOLS_TAG = process.env.SUI_TOOLS_TAG || (process.arch === 'arm64' - ? '5ce2a8c246577d36160e296d6051c8f5e59f93b4-arm64' - : '5ce2a8c246577d36160e296d6051c8f5e59f93b4'); + ? '951cae315d8b252131836a331bcc16b89eb340d6-arm64' + : '951cae315d8b252131836a331bcc16b89eb340d6'); export default async function setup(project: TestProject) { console.log('Starting test containers'); diff --git a/sdk/pnpm-lock.yaml b/sdk/pnpm-lock.yaml index ac0b9a6..3e518c5 100644 --- a/sdk/pnpm-lock.yaml +++ b/sdk/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^0.6.0 version: 0.6.0 '@mysten/sui': - specifier: ^2.4.0 - version: 2.4.0(typescript@5.9.3) + specifier: ^2.6.0 + version: 2.6.0(typescript@5.9.3) example-app: devDependencies: @@ -450,6 +450,10 @@ packages: resolution: {integrity: sha512-2EG5+lTypWMgU3lWyKlcjopQ++Ae9BkoROOBVcJ6mYwM5o1IcKnoc7rFqr94KQClYmBFV2aFz5+aKm5okatoBw==} engines: {node: '>=22'} + '@mysten/sui@2.6.0': + resolution: {integrity: sha512-Dp3z7mDuUCXGgldQ3/AtC1iDiK48XTuAi//fPrHdxEaMl+f5VLjbYtB+mlKNC1SVYLKOUjTeF/RA9qfEBY++pA==} + engines: {node: '>=22'} + '@mysten/utils@0.3.1': resolution: {integrity: sha512-36KhxG284uhDdSnlkyNaS6fzKTX9FpP2WQWOwUKIRsqQFFIm2ooCf2TP1IuqrtMpkairwpiWkAS0eg7cpemVzg==} @@ -2241,7 +2245,7 @@ snapshots: '@mysten/codegen@0.6.0': dependencies: '@mysten/bcs': 2.0.2 - '@mysten/sui': 2.4.0(typescript@5.9.3) + '@mysten/sui': 2.6.0(typescript@5.9.3) '@stricli/auto-complete': 1.2.5 '@stricli/core': 1.2.5 '@types/node': 25.0.9 @@ -2276,6 +2280,28 @@ snapshots: - '@gql.tada/vue-support' - typescript + '@mysten/sui@2.6.0(typescript@5.9.3)': + dependencies: + '@graphql-typed-document-node/core': 3.2.0(graphql@16.12.0) + '@mysten/bcs': 2.0.2 + '@mysten/utils': 0.3.1 + '@noble/curves': 2.0.1 + '@noble/hashes': 2.0.1 + '@protobuf-ts/grpcweb-transport': 2.11.1 + '@protobuf-ts/runtime': 2.11.1 + '@protobuf-ts/runtime-rpc': 2.11.1 + '@scure/base': 2.0.0 + '@scure/bip32': 2.0.1 + '@scure/bip39': 2.0.1 + gql.tada: 1.9.0(graphql@16.12.0)(typescript@5.9.3) + graphql: 16.12.0 + poseidon-lite: 0.2.1 + valibot: 1.2.0(typescript@5.9.3) + transitivePeerDependencies: + - '@gql.tada/svelte-support' + - '@gql.tada/vue-support' + - typescript + '@mysten/utils@0.3.1': dependencies: '@scure/base': 2.0.0 From 8831a52a1015c7efa487588eaa709b17bfdfda58 Mon Sep 17 00:00:00 2001 From: Manos Liolios Date: Wed, 11 Mar 2026 15:25:05 +0200 Subject: [PATCH 2/2] lint fix --- sdk/pas/src/contracts/pas/keys.ts | 5 ++++- sdk/pas/src/resolution.ts | 18 +++++++++++------ sdk/pas/test/e2e/e2e.isolated.test.ts | 29 +++++++++++++++++++-------- 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/sdk/pas/src/contracts/pas/keys.ts b/sdk/pas/src/contracts/pas/keys.ts index 376362f..e78d292 100644 --- a/sdk/pas/src/contracts/pas/keys.ts +++ b/sdk/pas/src/contracts/pas/keys.ts @@ -8,7 +8,10 @@ import { MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from ' const $moduleName = '@mysten/pas::keys'; export const PolicyKey = new MoveTuple({ name: `${$moduleName}::PolicyKey`, fields: [bcs.bool()] }); -export const AccountKey = new MoveTuple({ name: `${$moduleName}::AccountKey`, fields: [bcs.Address] }); +export const AccountKey = new MoveTuple({ + name: `${$moduleName}::AccountKey`, + fields: [bcs.Address], +}); export const TemplateKey = new MoveTuple({ name: `${$moduleName}::TemplateKey`, fields: [bcs.bool()], diff --git a/sdk/pas/src/resolution.ts b/sdk/pas/src/resolution.ts index ccccb70..46d6ccb 100644 --- a/sdk/pas/src/resolution.ts +++ b/sdk/pas/src/resolution.ts @@ -196,10 +196,12 @@ export function buildMoveCallCommandFromTemplate( ); } } else if (arg.Input.Ext) { - resolvedArgs.push(resolveRawPasRequest(args, { - _namespace: arg.Input.Ext.namespace, - value: arg.Input.Ext.value, - })); + resolvedArgs.push( + resolveRawPasRequest(args, { + _namespace: arg.Input.Ext.namespace, + value: arg.Input.Ext.value, + }), + ); } else { throw new PASClientError(`Unsupported input kind: ${arg.Input.$kind}`); } @@ -224,7 +226,10 @@ export function buildMoveCallCommandFromTemplate( }); } -function resolveRawPasRequest(args: RawCommandBuildArgs, extInput: { _namespace: string, value: string }): Argument { +function resolveRawPasRequest( + args: RawCommandBuildArgs, + extInput: { _namespace: string; value: string }, +): Argument { // do the logic on `namespace` here // return error if it's not PAS @@ -236,7 +241,8 @@ function resolveRawPasRequest(args: RawCommandBuildArgs, extInput: { _namespace: if (!args.policy) throw new PASClientError(`Policy is not set in the context.`); return args.policy; case 'sender_account': - if (!args.senderAccount) throw new PASClientError(`Sender account is not set in the context.`); + if (!args.senderAccount) + throw new PASClientError(`Sender account is not set in the context.`); return args.senderAccount; case 'receiver_account': if (!args.receiverAccount) diff --git a/sdk/pas/test/e2e/e2e.isolated.test.ts b/sdk/pas/test/e2e/e2e.isolated.test.ts index b87afd8..3a58dc5 100644 --- a/sdk/pas/test/e2e/e2e.isolated.test.ts +++ b/sdk/pas/test/e2e/e2e.isolated.test.ts @@ -3,7 +3,12 @@ import { normalizeStructTag, normalizeSuiAddress } from '@mysten/sui/utils'; import { describe, expect, it } from 'vitest'; import { DemoUsdTestHelpers } from './demoUsd.ts'; -import { executeTransaction, setupToolbox, simulateFailingTransaction, type TestToolbox } from './setup.ts'; +import { + executeTransaction, + setupToolbox, + simulateFailingTransaction, + type TestToolbox, +} from './setup.ts'; async function expectBalances( toolbox: TestToolbox, @@ -50,7 +55,10 @@ describe.concurrent( // Create the account for the address. await toolbox.createAccountForAddress(toolbox.address()); - const { balance: accountBalanceAfterTransfer } = await toolbox.getBalance(accountId, suiTypeName); + const { balance: accountBalanceAfterTransfer } = await toolbox.getBalance( + accountId, + suiTypeName, + ); expect(Number(accountBalanceAfterTransfer.balance)).toBe(1_000_000_000); // try to do an unlock but it should fail because `policy` for Sui does not exist. @@ -84,7 +92,10 @@ describe.concurrent( await toolbox.executeTransaction(unlockTx); - const { balance: accountBalanceAfterUnlock } = await toolbox.getBalance(accountId, suiTypeName); + const { balance: accountBalanceAfterUnlock } = await toolbox.getBalance( + accountId, + suiTypeName, + ); expect(Number(accountBalanceAfterUnlock.balance)).toBe(0); }); @@ -186,9 +197,9 @@ describe.concurrent( const receiverAccountId = toolbox.client.pas.deriveAccountAddress(receiver); // Verify neither account exists. - await expect(toolbox.client.core.getObject({ objectId: senderAccountId })).rejects.toThrowError( - 'not found', - ); + await expect( + toolbox.client.core.getObject({ objectId: senderAccountId }), + ).rejects.toThrowError('not found'); await expect( toolbox.client.core.getObject({ objectId: receiverAccountId }), ).rejects.toThrowError('not found'); @@ -336,8 +347,10 @@ describe.concurrent( assetType: demoUsd.demoUsdAssetType, }), ); - - expect(executeTransaction(toolbox, transaction)).rejects.toThrowError('InsufficientFundsForWithdraw'); + + expect(executeTransaction(toolbox, transaction)).rejects.toThrowError( + 'InsufficientFundsForWithdraw', + ); }); it('use_v2 upgrades approval logic and the resolver picks up the new template', async () => {