Commit 9affced
fix(sdk-coin-polyx): fix address creation flow for Polyx
Before this change, `TransactionBuilderFactory.getWalletInitializationBuilder()`
threw `NotImplementedError` and `Polyx.requiresWalletInitializationTransaction()`
inherited the base class default of `false`. Together these caused the
wallet initialization transaction to never be built or enqueued, so
the CDD DID-registration step was skipped and address creation
subsequently failed because the chain initialization was never
triggered.
Fix: route `getWalletInitializationBuilder()` to the existing
`getRegisterDidWithCDDBuilder()` implementation, and override
`requiresWalletInitializationTransaction()` to return `true` on the
`Polyx` coin class (inherited by `Tpolyx`). This matches the pattern
used by other coins that require on-chain initialization (Canton,
Starknet) and correctly signals to the SDK wallet layer that a
CDD registration transaction must be submitted before an address
can receive funds.
Add unit tests verifying both behaviors for polyx and tpolyx.
Ticket: CECHO-58
Session-Id: 0594e2d8-7ed3-4626-ad92-ec5f2f0d5f8c
Task-Id: 3a7836f7-b547-445f-9860-54583a5ab35f1 parent 3086eaa commit 9affced
4 files changed
Lines changed: 40 additions & 3 deletions
File tree
- modules/sdk-coin-polyx
- src
- lib
- test/unit
- transactionBuilder
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | | - | |
| 156 | + | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
370 | 375 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
363 | 374 | | |
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
247 | 248 | | |
248 | 249 | | |
249 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
250 | 271 | | |
0 commit comments