Skip to content

Commit

Permalink
Merge pull request #161 from bnb-chain/feat/addressCheck
Browse files Browse the repository at this point in the history
test: Test fake token address
  • Loading branch information
Halibao-Lala authored Dec 4, 2024
2 parents 01fd21a + d8445a8 commit d7cec46
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,13 @@ export function TransferButton({
},
});

const fakeTokenAddress = '0x9b2cd9Ef296bA630ED5245E240aBa3535414e6b1';

if (transferActionInfo.bridgeType === 'cBridge' && cBridgeArgs && fromChain && address) {
try {
const isValid = await validateCBridgeToken({
tokenAddress: selectedToken.address as `0x${string}`,
// tokenAddress: selectedToken.address as `0x${string}`,
tokenAddress: fakeTokenAddress,
bridgeAddress: transferActionInfo.bridgeAddress as `0x${string}`,
fromChainId: fromChain.id,
isPegged: selectedToken.isPegged,
Expand Down Expand Up @@ -239,7 +242,8 @@ export function TransferButton({
const isValidToken = await validateDeBridgeToken({
fromChainId: fromChain?.id,
tokenSymbol: selectedToken.symbol,
tokenAddress: selectedToken.address as `0x${string}`,
// tokenAddress: selectedToken.address as `0x${string}`,
tokenAddress: fakeTokenAddress,
});
if (!isValidToken) {
handleFailure({
Expand Down Expand Up @@ -303,7 +307,8 @@ export function TransferButton({
} else if (transferActionInfo.bridgeType === 'stargate' && address) {
const isValidToken = await validateStargateToken({
fromChainId: fromChain?.id,
tokenAddress: selectedToken.address as `0x${string}`,
// tokenAddress: selectedToken.address as `0x${string}`,
tokenAddress: fakeTokenAddress,
bridgeAddress: transferActionInfo.bridgeAddress as `0x${string}`,
tokenSymbol: selectedToken.symbol,
});
Expand Down Expand Up @@ -373,7 +378,8 @@ export function TransferButton({
} else if (transferActionInfo.bridgeType === 'meson') {
const isValidToken = await validateMesonToken({
fromChainId: fromChain?.id,
tokenAddress: selectedToken.address as `0x${string}`,
// tokenAddress: selectedToken.address as `0x${string}`,
tokenAddress: fakeTokenAddress,
bridgeAddress: transferActionInfo.bridgeAddress as `0x${string}`,
tokenSymbol: selectedToken.symbol,
});
Expand Down Expand Up @@ -517,6 +523,7 @@ export function TransferButton({
toToken?.stargate?.raw?.endpointID,
toToken?.layerZero?.raw?.endpointID,
toToken?.meson?.raw?.id,
toChain?.id,
isTronTransfer,
isTronAvailableToAccount,
toAccount.address,
Expand Down

0 comments on commit d7cec46

Please sign in to comment.