Commit 17fd5cb
fix(sdk-core): stamp enterprise-id header on getVaultConfig call
DefiVault.getVaultConfig() was calling the defi-service vault config
endpoint without the `enterprise-id` header that defi-service requires.
This caused the entire deposit flow to fail for UI clients whose access
tokens don't have `accessToken.enterprise` populated as a fallback in
WP's auth resolution.
Fix: call `.set('enterprise-id', this.wallet.toJSON().enterprise)` on
the GET request. The enterprise id is sourced directly from the wallet
context via the IWallet.toJSON() accessor — no constructor change needed.
Tests: add `enterprise: 'test-enterprise-id'` to mock wallet data,
add `set: sinon.stub().returnsThis()` to mockRequest helper, and assert
`.set('enterprise-id', 'test-enterprise-id')` is called on the GET.
Ticket: DEFI-496
Session-Id: 1434552b-96ce-4eac-9922-cc2288aa5054
Task-Id: ba541f90-9eb1-45ed-a30f-a0605abde1781 parent 90d0c0f commit 17fd5cb
2 files changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| |||
0 commit comments