Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,6 @@
},
"packageManager": "pnpm@11.1.0",
"pnpm": {
"overrides": {
"use-sync-external-store": "^1.2.0",
"valtio": "^1.13.2",
"@paulmillr/qr": "npm:qr@^0.5.0",
"@walletconnect/modal": "2.7.0",
"@types/react": "^19.1.8",
"@wagmi/core": "^2.20.3",
"glob": "^11.1.0",
"zod": "^3.25.76",
"viem": "2.44.4",
"@midnight-ntwrk/midnight-js-contracts": "2.0.2",
"@midnight-ntwrk/midnight-js-http-client-proof-provider": "2.0.2",
"@midnight-ntwrk/midnight-js-indexer-public-data-provider": "2.0.2",
"@midnight-ntwrk/midnight-js-network-id": "2.0.2",
"@midnight-ntwrk/midnight-js-types": "2.0.2",
"@midnight-ntwrk/midnight-js-utils": "2.0.2"
},
"patchedDependencies": {
"@midnight-ntwrk/compact-runtime@0.9.0": "patches/@midnight-ntwrk__compact-runtime@0.9.0.patch",
"@midnight-ntwrk/midnight-js-contracts@2.0.2": "patches/@midnight-ntwrk__midnight-js-contracts@2.0.2.patch",
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-evm-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"typescript": "^5.9.2",
"vitest": "^3.2.4",
"vitest": "^4.1.0",
"wagmi": "^2.16.1"
},
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"react-hook-form": "^7.62.0",
"typescript": "^5.9.2",
"viem": "^2.33.3",
"vitest": "^3.2.4",
"vitest": "^4.1.0",
"wagmi": "^2.16.1"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-midnight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"typescript": "^5.9.2",
"vitest": "^3.2.4"
"vitest": "^4.1.0"
},
"peerDependencies": {
"@openzeppelin/ui-components": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-polkadot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"typescript": "^5.9.2",
"vitest": "^3.2.4"
"vitest": "^4.1.0"
},
"peerDependencies": {
"@openzeppelin/ui-types": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-runtime-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"@openzeppelin/ui-types": "^3.1.0",
"@types/node": "^25.0.0",
"typescript": "^5.9.2",
"vitest": "^3.2.4"
"vitest": "^4.1.0"
}
}
2 changes: 1 addition & 1 deletion packages/adapter-solana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"eslint": "^9.32.0",
"react": "^19.0.0",
"typescript": "^5.9.2",
"vitest": "^3.2.4"
"vitest": "^4.1.0"
},
"peerDependencies": {
"@openzeppelin/ui-types": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-stellar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"react-dom": "^19.0.0",
"react-hook-form": "^7.62.0",
"typescript": "^5.9.2",
"vitest": "^3.2.4"
"vitest": "^4.1.0"
},
"peerDependencies": {
"@openzeppelin/ui-components": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ import { validateExpirationLedger } from '../../src/access-control/validation';
// Mock the Stellar SDK
vi.mock('@stellar/stellar-sdk', () => ({
rpc: {
Server: vi.fn().mockImplementation(() => ({
getLatestLedger: vi.fn().mockResolvedValue({
sequence: 12345678,
}),
})),
Server: vi.fn().mockImplementation(function () {
return {
getLatestLedger: vi.fn().mockResolvedValue({
sequence: 12345678,
}),
};
}),
},
}));

Expand Down Expand Up @@ -86,9 +88,11 @@ describe('Two-Step Ownable Support', () => {
vi.resetModules();
vi.doMock('@stellar/stellar-sdk', () => ({
rpc: {
Server: vi.fn().mockImplementation(() => ({
getLatestLedger: vi.fn().mockRejectedValue(new Error('Network error')),
})),
Server: vi.fn().mockImplementation(function () {
return {
getLatestLedger: vi.fn().mockRejectedValue(new Error('Network error')),
};
}),
},
}));

Expand Down Expand Up @@ -719,9 +723,11 @@ describe('Two-Step Ownable Support', () => {
vi.resetModules();
vi.doMock('@stellar/stellar-sdk', () => ({
rpc: {
Server: vi.fn().mockImplementation(() => ({
getLatestLedger: vi.fn().mockRejectedValue(new Error('Request timeout')),
})),
Server: vi.fn().mockImplementation(function () {
return {
getLatestLedger: vi.fn().mockRejectedValue(new Error('Request timeout')),
};
}),
},
}));

Expand All @@ -736,9 +742,11 @@ describe('Two-Step Ownable Support', () => {
vi.resetModules();
vi.doMock('@stellar/stellar-sdk', () => ({
rpc: {
Server: vi.fn().mockImplementation(() => ({
getLatestLedger: vi.fn().mockRejectedValue(new Error('ECONNREFUSED')),
})),
Server: vi.fn().mockImplementation(function () {
return {
getLatestLedger: vi.fn().mockRejectedValue(new Error('ECONNREFUSED')),
};
}),
},
}));

Expand Down Expand Up @@ -811,11 +819,13 @@ describe('Two-Step Ownable Support', () => {
vi.resetModules();
vi.doMock('@stellar/stellar-sdk', () => ({
rpc: {
Server: vi.fn().mockImplementation(() => ({
getLatestLedger: vi.fn().mockResolvedValue({
sequence: 12345678,
}),
})),
Server: vi.fn().mockImplementation(function () {
return {
getLatestLedger: vi.fn().mockResolvedValue({
sequence: 12345678,
}),
};
}),
},
}));

Expand Down
6 changes: 3 additions & 3 deletions packages/adapter-stellar/test/contract/loader-sac.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ vi.mock('@stellar/stellar-sdk', () => ({
isValidContract: vi.fn(() => true),
},
contract: {
Spec: vi.fn(() => ({
funcs: () => [],
})),
Spec: vi.fn(function () {
return { funcs: () => [] };
}),
},
}));

Expand Down
8 changes: 6 additions & 2 deletions packages/adapter-stellar/test/contract/type-detection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import type { StellarNetworkConfig } from '@openzeppelin/ui-types';
// T004: Unit test for contract type detection (SAC vs Wasm)

const getLedgerEntriesMock = vi.fn();
const serverCtorMock = vi.fn(() => ({ getLedgerEntries: getLedgerEntriesMock }));
const serverCtorMock = vi.fn(function () {
return { getLedgerEntries: getLedgerEntriesMock };
});
const contractFootprintMock = vi.fn(() => 'mock-footprint');
const contractCtorMock = vi.fn(() => ({ getFootprint: contractFootprintMock }));
const contractCtorMock = vi.fn(function () {
return { getFootprint: contractFootprintMock };
});

const createLedgerEntry = (executableName: string) => ({
contractData: () => ({
Expand Down
28 changes: 16 additions & 12 deletions packages/adapter-stellar/test/query/sac-query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,28 @@ vi.mock('@stellar/stellar-sdk', async (importOriginal) => {
return {
...actual,
BASE_FEE: '100',
Contract: vi.fn(() => ({
call: () => ({}),
})),
Contract: vi.fn(function () {
return { call: () => ({}) };
}),
Address: {
fromString: vi.fn(() => true),
},
Account: vi.fn(() => ({})),
Account: vi.fn(function () {
return {};
}),
Keypair: { random: () => ({ publicKey: () => 'GABC' }) },
TransactionBuilder: vi.fn(() => ({
addOperation: transactionAddOperationMock,
setTimeout: transactionSetTimeoutMock,
build: transactionBuildMock,
})),
TransactionBuilder: vi.fn(function () {
return {
addOperation: transactionAddOperationMock,
setTimeout: transactionSetTimeoutMock,
build: transactionBuildMock,
};
}),
nativeToScVal: nativeToScValMock,
rpc: {
Server: vi.fn(() => ({
simulateTransaction: simulateTransactionMock,
})),
Server: vi.fn(function () {
return { simulateTransaction: simulateTransactionMock };
}),
Api: {
isSimulationError: () => false,
},
Expand Down
28 changes: 16 additions & 12 deletions packages/adapter-stellar/test/query/state-mutability.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,27 @@ vi.mock('@stellar/stellar-sdk', async (importOriginal) => {
return {
...actual,
BASE_FEE: '100',
Contract: vi.fn(() => ({
call: () => ({}),
})),
Contract: vi.fn(function () {
return { call: () => ({}) };
}),
Address: {
fromString: vi.fn(() => true),
},
Account: vi.fn(() => ({})),
TransactionBuilder: vi.fn(() => ({
addOperation: vi.fn().mockReturnThis(),
setTimeout: vi.fn().mockReturnThis(),
build: vi.fn(() => ({ toXDR: () => 'mock-xdr' })),
})),
Account: vi.fn(function () {
return {};
}),
TransactionBuilder: vi.fn(function () {
return {
addOperation: vi.fn().mockReturnThis(),
setTimeout: vi.fn().mockReturnThis(),
build: vi.fn(() => ({ toXDR: () => 'mock-xdr' })),
};
}),
nativeToScVal: vi.fn((value: unknown) => value),
rpc: {
Server: vi.fn(() => ({
simulateTransaction: simulateTransactionMock,
})),
Server: vi.fn(function () {
return { simulateTransaction: simulateTransactionMock };
}),
Api: {
isSimulationError: () => false,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/adapters-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"eslint": "^9.32.0",
"typescript": "^5.9.2",
"vite": "^8.0.5",
"vitest": "^3.2.4"
"vitest": "^4.1.0"
},
"exports": {
".": {
Expand Down
Loading
Loading