diff --git a/packages/sdk/src/pallets/assets/getOriginFeeDetails.test.ts b/packages/sdk/src/pallets/assets/getOriginFeeDetails.test.ts index 8547cfcc..59302c16 100644 --- a/packages/sdk/src/pallets/assets/getOriginFeeDetails.test.ts +++ b/packages/sdk/src/pallets/assets/getOriginFeeDetails.test.ts @@ -14,7 +14,8 @@ import type { Extrinsic } from '../../pjs/types' const apiMock = { init: vi.fn(), calculateTransactionFee: vi.fn().mockResolvedValue(BigInt('1000000000')), - disconnect: vi.fn() + disconnect: vi.fn(), + setDisconnectAllowed: vi.fn() } as unknown as IPolkadotApi describe('getOriginFeeDetails', () => { diff --git a/packages/sdk/src/pallets/assets/getOriginFeeDetails.ts b/packages/sdk/src/pallets/assets/getOriginFeeDetails.ts index f8be5298..cabb5ca3 100644 --- a/packages/sdk/src/pallets/assets/getOriginFeeDetails.ts +++ b/packages/sdk/src/pallets/assets/getOriginFeeDetails.ts @@ -74,10 +74,11 @@ export const getOriginFeeDetails = async ( options: TGetOriginFeeDetailsOptions ): Promise => { const { api } = options - + api.setDisconnectAllowed(false) try { return await getOriginFeeDetailsInternal(options) } finally { + api.setDisconnectAllowed(true) await api.disconnect() } }