Skip to content

Commit

Permalink
fix: move max size bytes error message to hook
Browse files Browse the repository at this point in the history
  • Loading branch information
brancoder committed Jan 31, 2025
1 parent 7a94600 commit abe1354
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions apps/core/src/hooks/useMaxTransactionSizeBytes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import { useIotaClient } from '@iota/dapp-kit';
import { useQuery } from '@tanstack/react-query';

export const MAX_SIZE_BYTES_ERROR =
'Attempting to serialize to BCS, but buffer does not have enough size';

export function useMaxTransactionSizeBytes() {
const client = useIotaClient();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { TransactionDialogView } from '../TransactionDialog';
import { MigrationDialogView } from './enums';
import { ConfirmMigrationView } from './views';
import { ampli } from '@/lib/utils/analytics';
import { MAX_SIZE_BYTES_ERROR } from '@iota/core';

// Number of objects to reduce on every attempt
const REDUCTION_STEP_SIZE = 5;
const MAX_SIZE_BYTES_ERROR = 'Attempting to serialize to BCS, but buffer does not have enough size';
interface MigrationDialogProps {
handleClose: () => void;
basicOutputObjects: IotaObjectData[] | undefined;
Expand Down

0 comments on commit abe1354

Please sign in to comment.