Skip to content

Commit

Permalink
resolved antons comment about tests
Browse files Browse the repository at this point in the history
  • Loading branch information
saadahmsiddiqui committed Aug 29, 2024
1 parent d0cf116 commit 23b9add
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
14 changes: 14 additions & 0 deletions packages/evm/src/__test__/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Eip1193Provider } from '@buildwithsygma/core';

export const ASSET_TRANSFER_PARAMS = {
source: 1,
destination: 2,
sourceAddress: '0x98729c03c4D5e820F5e8c45558ae07aE63F97461',
sourceNetworkProvider: jest.fn() as unknown as Eip1193Provider,
recipientAddress: '0x98729c03c4D5e820F5e8c45558ae07aE63F97461',
resource: {
address: '0x98729c03c4D5e820F5e8c45558ae07aE63F97461',
resourceId: '0x0',
caip19: '0x11',
},
};
15 changes: 5 additions & 10 deletions packages/evm/src/__test__/fungible.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Eip1193Provider } from '@buildwithsygma/core';
import { Network, Config, ResourceType } from '@buildwithsygma/core';
import {
BasicFeeHandler__factory,
Expand All @@ -13,19 +12,15 @@ import { parseEther } from 'ethers/lib/utils.js';
import { createFungibleAssetTransfer } from '../fungibleAssetTransfer.js';
import type { TransactionRequest } from '../types.js';

import { ASSET_TRANSFER_PARAMS } from './constants.js';

const TRANSFER_PARAMS = {
source: 1,
destination: 2,
sourceAddress: '0x98729c03c4D5e820F5e8c45558ae07aE63F97461',
sourceNetworkProvider: jest.fn() as unknown as Eip1193Provider,
...ASSET_TRANSFER_PARAMS,
resource: {
address: '0x98729c03c4D5e820F5e8c45558ae07aE63F97461',
type: ResourceType.FUNGIBLE,
resourceId: '0x0',
caip19: '0x11',
...ASSET_TRANSFER_PARAMS.resource,
type: ResourceType.NON_FUNGIBLE,
},
amount: parseEther('10').toBigInt(),
recipientAddress: '0x98729c03c4D5e820F5e8c45558ae07aE63F97461',
};

const MOCKED_CONFIG = {
Expand Down
13 changes: 4 additions & 9 deletions packages/evm/src/__test__/nonFungible.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Eip1193Provider } from '@buildwithsygma/core';
import { Config, FeeHandlerType, Network, ResourceType } from '@buildwithsygma/core';
import {
BasicFeeHandler__factory,
Expand All @@ -12,19 +11,15 @@ import { parseEther } from 'ethers/lib/utils.js';
import { createNonFungibleAssetTransfer } from '../nonFungibleAssetTransfer.js';
import type { NonFungibleTransferParams } from '../types.js';

import { ASSET_TRANSFER_PARAMS } from './constants.js';

const TRANSFER_PARAMS: NonFungibleTransferParams = {
source: 1,
destination: 2,
sourceAddress: '0x98729c03c4D5e820F5e8c45558ae07aE63F97461',
sourceNetworkProvider: jest.fn() as unknown as Eip1193Provider,
...ASSET_TRANSFER_PARAMS,
resource: {
address: '0x98729c03c4D5e820F5e8c45558ae07aE63F97461',
...ASSET_TRANSFER_PARAMS.resource,
type: ResourceType.NON_FUNGIBLE,
resourceId: '0x0',
caip19: '0x11',
},
tokenId: parseEther('10').toString(),
recipientAddress: '0x98729c03c4D5e820F5e8c45558ae07aE63F97461',
};

const MOCKED_CONFIG = {
Expand Down

0 comments on commit 23b9add

Please sign in to comment.