Commit 02a4e77
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,
consistent with how the wallet already owns its own data.
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 6a45ec4 commit 02a4e77
2 files changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | 52 | | |
54 | | - | |
| 53 | + | |
55 | 54 | | |
56 | 55 | | |
57 | | - | |
58 | 56 | | |
59 | 57 | | |
60 | 58 | | |
| |||
67 | 65 | | |
68 | 66 | | |
69 | 67 | | |
70 | | - | |
| 68 | + | |
71 | 69 | | |
72 | 70 | | |
73 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3301 | 3301 | | |
3302 | 3302 | | |
3303 | 3303 | | |
3304 | | - | |
| 3304 | + | |
3305 | 3305 | | |
3306 | 3306 | | |
3307 | 3307 | | |
| |||
0 commit comments