You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: make balance hydration best-effort in RetrieveCurrentAccount (#1441)
When Position Keeping service is unavailable, RetrieveCurrentAccount now
returns the account with empty balance instead of failing with an internal
error. This aligns with the existing best-effort pattern used in
ExecuteDeposit and ExecuteWithdrawal.
Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>
assert.Contains(t, st.Message(), "Position Keeping", "Error should mention Position Keeping")
1556
+
// Verify success with degraded response (zero balance, not hydrated)
1557
+
require.NoError(t, err, "Retrieve should succeed even when Position Keeping is unavailable")
1558
+
assert.NotNil(t, resp.Facility, "Account facility should be returned")
1559
+
assert.Equal(t, int64(0), resp.Facility.CurrentBalance.CurrentBalance.Amount.Units, "Balance should be zero when Position Keeping is unavailable")
1560
+
assert.Equal(t, int32(0), resp.Facility.CurrentBalance.CurrentBalance.Amount.Nanos, "Balance nanos should be zero when Position Keeping is unavailable")
1561
1561
1562
1562
// Verify Position Keeping was called
1563
1563
assert.Equal(t, 1, mockPosKeeping.getBalanceCalls, "GetAccountBalance should have been called once")
0 commit comments