Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 20 additions & 27 deletions pnpm-lock.yaml
Comment thread
evavirseda marked this conversation as resolved.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sdk/isc-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@types/node": "^24.0.0",
"dotenv": "^16.4.5",
"ethers": "^6.13.5",
"ts-retry-promise": "^0.8.1",
"tsx": "^4.8.1",
"typescript": "^5.5.3",
"vitest": "^4.1.0",
Expand Down
16 changes: 6 additions & 10 deletions sdk/isc-sdk/tests/L1ToL2Tokens.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ import {
} from '../src/index';
import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils';
import { Ed25519Keypair } from '@iota/iota-sdk/keypairs/ed25519';
import { requestIotaFromFaucet } from '@iota/iota-sdk/faucet';
import { IotaClient } from '@iota/iota-sdk/client';
import { beforeAll, expect, test } from 'vitest';
import { CONFIG } from './config';
import { Wallet } from 'ethers';
import { bcs } from '@iota/iota-sdk/bcs';
import { checkL2BalanceWithRetries, requestFunds } from './utils';
import { checkL2BalanceWithRetries, fundFromFaucet, requestFunds } from './utils';

const { L1 } = CONFIG;

Expand All @@ -32,11 +31,6 @@ test('Send IOTA', async () => {
const keypair = new Ed25519Keypair();
const address = keypair.toIotaAddress();

await requestIotaFromFaucet({
host: L1.faucetUrl!,
recipient: address,
});

const wallet = Wallet.createRandom();

// EVM Address
Expand All @@ -46,6 +40,8 @@ test('Send IOTA', async () => {
// We also need to place a little more in the bag to cover the L2 gas
const amountToPlace = amountToSend + L2_FROM_L1_GAS_BUDGET;

await fundFromFaucet(client, L1.faucetUrl!, address, amountToPlace);

const iscTx = new IscTransaction(L1);

const bag = iscTx.newBag();
Expand All @@ -69,7 +65,7 @@ test('Send IOTA', async () => {
});

const evmBalance = await checkL2BalanceWithRetries(recipientAddress);
expect(evmBalance?.baseTokens).toEqual(amountToSend.toString());
expect(evmBalance.baseTokens).toEqual(amountToSend.toString());
});

test('Send Non-IOTA Tokens', async () => {
Expand Down Expand Up @@ -134,8 +130,8 @@ test('Send Non-IOTA Tokens', async () => {
});

const evmBalance = await checkL2BalanceWithRetries(recipientAddress, TOKEN_COIN_TYPE);
expect(evmBalance?.baseTokens).toEqual(amountToSend.toString());
expect(evmBalance?.nativeTokens).toEqual([
expect(evmBalance.baseTokens).toEqual(amountToSend.toString());
expect(evmBalance.nativeTokens).toEqual([
{
coinType: TOKEN_COIN_TYPE,
balance: tokenAmountToSend.toString(),
Expand Down
Loading
Loading