Skip to content

Commit

Permalink
Merge branch 'lf/fix/dont-allow-send-to-asset-address' of github.com:…
Browse files Browse the repository at this point in the history
…FuelLabs/fuels-wallet into lf/fix/dont-allow-send-to-asset-address
  • Loading branch information
LuizAsFight committed Nov 18, 2024
2 parents 97644a5 + 65d4fee commit 133b1b1
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions packages/app/src/systems/Send/hooks/useSend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import { useTransactionRequest } from '~/systems/DApp';
import { TxRequestStatus } from '~/systems/DApp/machines/transactionRequestMachine';
import type { TxInputs } from '~/systems/Transaction/services';

import { getAssetFuelCurrentChain } from '~/systems/Asset';
import { AssetsCache } from '~/systems/Asset/cache/AssetsCache';
import { AssetService } from '~/systems/Asset/services/assets';
import { useProvider } from '~/systems/Network/hooks/useProvider';
import { formatGasLimit } from '~/systems/Transaction';
import { sendMachine } from '../machines/sendMachine';
Expand Down Expand Up @@ -142,24 +140,6 @@ const schemaFactory = (provider?: Provider) =>
});
}

const assets = await AssetService.getAssets();
const fuelAssets = await Promise.all(
assets.map(async (asset) => {
return getAssetFuelCurrentChain({
asset,
chainId: provider.getChainId(),
});
})
);
const assetInDb = fuelAssets.find(
(asset) => asset?.assetId === value
);
if (assetInDb) {
return ctx.createError({
message: `You can't send to Asset address`,
});
}

const assetCached = await AssetsCache.getInstance().getAsset({
chainId: provider.getChainId(),
assetId: value,
Expand Down

0 comments on commit 133b1b1

Please sign in to comment.