Skip to content

Commit

Permalink
refactor: 💡 pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sansan committed Jul 31, 2024
1 parent 8e84740 commit 46670d3
Show file tree
Hide file tree
Showing 8 changed files with 289 additions and 291 deletions.
5 changes: 3 additions & 2 deletions src/api/client/ConfidentialAccounts.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Context, PolymeshError } from '@polymeshassociation/polymesh-sdk/internal';
import { ErrorCode } from '@polymeshassociation/polymesh-sdk/types';

import { moveFunds, MoveFundsArgs, MoveFundsResolverResult } from '~/api/procedures/moveFunds';
import { moveFunds } from '~/api/procedures/moveFunds';
import {
applyIncomingAssetBalance,
applyIncomingConfidentialAssetBalances,
Expand All @@ -14,6 +14,7 @@ import {
ConfidentialProcedureMethod,
CreateConfidentialAccountParams,
IncomingConfidentialAssetBalance,
MoveFundsArgs,
} from '~/types';
import { createConfidentialProcedureMethod } from '~/utils/internal';

Expand Down Expand Up @@ -105,5 +106,5 @@ export class ConfidentialAccounts {
/**
* Moves funds from one Confidential Account to another Confidential Account belonging to the same signing Identity
*/
public moveFunds: ConfidentialProcedureMethod<MoveFundsArgs, MoveFundsResolverResult>;
public moveFunds: ConfidentialProcedureMethod<MoveFundsArgs, void>;
}
18 changes: 9 additions & 9 deletions src/api/client/__tests__/ConfidentialAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import BigNumber from 'bignumber.js';
import { when } from 'jest-when';

import { ConfidentialAccounts } from '~/api/client/ConfidentialAccounts';
import { MoveFundsResolverResult } from '~/api/procedures/moveFunds';
import { ConfidentialAccount, Context, PolymeshError, PolymeshTransaction } from '~/internal';
import { dsMockUtils, entityMockUtils, procedureMockUtils } from '~/testUtils/mocks';
import { Mocked } from '~/testUtils/types';
Expand Down Expand Up @@ -134,14 +133,15 @@ describe('ConfidentialAccounts Class', () => {

describe('method: moveFunds', () => {
it('should prepare the procedure with the correct arguments and context, and return the resulting transaction', async () => {
const args = {
from: dsMockUtils.createMockConfidentialAccount() as unknown as ConfidentialAccount,
to: dsMockUtils.createMockConfidentialAccount() as unknown as ConfidentialAccount,
proofs: [{ asset: 'someAsset', proof: 'someProof' }],
};

const expectedTransaction =
'someTransaction' as unknown as PolymeshTransaction<MoveFundsResolverResult>;
const args = [
{
from: dsMockUtils.createMockConfidentialAccount() as unknown as ConfidentialAccount,
to: dsMockUtils.createMockConfidentialAccount() as unknown as ConfidentialAccount,
proofs: [{ asset: 'someAsset', proof: 'someProof' }],
},
];

const expectedTransaction = 'someTransaction' as unknown as PolymeshTransaction<void>;

when(procedureMockUtils.getPrepareMock())
.calledWith({ args, transformer: undefined }, context, {})
Expand Down
Loading

0 comments on commit 46670d3

Please sign in to comment.