Skip to content

Commit 4feda74

Browse files
committed
fix(ymax-planner): Expect policyVersion and rebalanceCount
1 parent b321fa3 commit 4feda74

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

services/ymax-planner/src/plan-deposit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export const handleDeposit = async (
240240
policyVersion,
241241
rebalanceCount,
242242
} = status;
243-
if (!targetAllocation) return [];
243+
if (!targetAllocation) return { policyVersion, rebalanceCount, steps: [] };
244244
const errors = [] as Error[];
245245
const balanceEntries = await Promise.all(
246246
positionKeys.map(async (posKey: PoolKey): Promise<[PoolKey, NatAmount]> => {

services/ymax-planner/test/deposit-tools.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ test('handleDeposit handles missing targetAllocation gracefully', async t => {
137137
Arbitrum: 'arbitrum:test:addr2',
138138
},
139139
// No targetAllocation
140+
policyVersion: 4,
141+
rebalanceCount: 0,
140142
};
141143
}
142144
throw new Error(`Unexpected path: ${path}`);
@@ -182,7 +184,7 @@ test('handleDeposit handles missing targetAllocation gracefully', async t => {
182184
cosmosRest: mockCosmosRestClient,
183185
});
184186

185-
t.deepEqual(result, []);
187+
t.deepEqual(result, { policyVersion: 4, rebalanceCount: 0, steps: [] });
186188
});
187189

188190
test('handleDeposit handles different position types correctly', async t => {

0 commit comments

Comments
 (0)