Use forceBatch in Staking Payout (#10736)

* force batch

* lint
This commit is contained in:
Przemek Rzad 2024-07-08 15:26:10 +02:00 committed by GitHub
parent 75558b9c7e
commit 6a471b0ca8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,7 @@
import type { ApiPromise } from '@polkadot/api';
import type { SubmittableExtrinsic } from '@polkadot/api/types';
import type { BatchOptions } from '@polkadot/react-hooks/types';
import type { u32 } from '@polkadot/types';
import type { EraIndex } from '@polkadot/types/interfaces';
import type { PayoutValidator } from './types.js';
@ -60,9 +61,10 @@ function PayButton ({ className, isAll, isDisabled, payout }: Props): React.Reac
const [isVisible, togglePayout] = useToggle();
const [accountId, setAccount] = useState<string | null>(null);
const [txs, setTxs] = useState<SubmittableExtrinsic<'promise'>[] | null>(null);
const batchOpts = useMemo(
const batchOpts = useMemo<BatchOptions>(
() => ({
max: 36 * 64 / ((api.consts.staking.maxNominatorRewardedPerValidator as u32)?.toNumber() || 64)
max: 36 * 64 / ((api.consts.staking.maxNominatorRewardedPerValidator as u32)?.toNumber() || 64),
type: 'force'
}),
[api]
);