Skip to content

Commit b2c2bc6

Browse files
committed
refac
1 parent ccfd8db commit b2c2bc6

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

packages/shared/src/treasury.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -651,11 +651,10 @@ export async function checkTreasuryPayoutsWhichAreAlreadyApprovedCanBePaid<
651651
// filter those spends which are pending or failed and is neither expired nor early payout
652652
const pendingOrFailedSpends = spends.filter((spend) => {
653653
const spendData = spend[1]?.unwrap()
654-
return (
655-
(spendData?.status.isPending || spendData?.status.isFailed) && // not pending or failed
656-
spendData?.validFrom.toNumber() < currentRelayChainBlockNumber && //not early payout
657-
spendData?.expireAt.toNumber() > currentRelayChainBlockNumber // not expired
658-
)
654+
const isSpendPendingOrFailed = spendData?.status.isPending || spendData?.status.isFailed
655+
const isSpendNotEarlyPayout = spendData?.validFrom.toNumber() < currentRelayChainBlockNumber
656+
const isSpendNotExpired = currentRelayChainBlockNumber < spendData?.expireAt.toNumber()
657+
return isSpendPendingOrFailed && isSpendNotEarlyPayout && isSpendNotExpired
659658
})
660659

661660
await assetHubClient.dev.newBlock()
@@ -714,7 +713,6 @@ export function baseTreasuryE2ETests<
714713
kind: 'describe',
715714
label: testConfig.testSuiteName,
716715
children: [
717-
// yarn test treasury -t "Propose and approve a spend of treasury funds"
718716
{
719717
kind: 'test',
720718
label: 'Propose and approve a spend of treasury funds',

0 commit comments

Comments
 (0)