Commit d65632f
fix(sdk-coin-eth): guard BN construction in signFinal for EIP-1559 txns
In Eth.signFinal (the second-signature path for WRW/offline-vault
transactions), the ethTxParams object was unconditionally calling
`new BN(txPrebuild.gasPrice)`. For EIP-1559 transactions, gasPrice
is absent from txPrebuild, so bn.js received undefined and threw
"Cannot read properties of undefined (reading 'toString')" internally.
The buildTransaction helper already handles EIP-1559 correctly by
consuming maxFeePerGas/maxPriorityFeePerGas from the eip1559 field and
ignoring gasPrice when eip1559 is present, so passing undefined is safe.
The fix skips BN construction when txPrebuild.eip1559 is set, preventing
the crash when users raise fees on EIP-1559 Ethereum transactions.
Added a WRWUnsignedSweepEIP1559ETHTx fixture and a corresponding test
that exercises the isLastSignature=true path with an EIP-1559 txPrebuild
(no gasPrice field).
Ticket: COINS-572
Session-Id: afc68d99-c916-424d-bffc-d814dea1d611
Task-Id: 60985a53-c0de-4df0-9fb9-187bad6e44641 parent 389f90c commit d65632f
3 files changed
Lines changed: 54 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | | - | |
| 432 | + | |
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
154 | 181 | | |
155 | 182 | | |
156 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
488 | 514 | | |
0 commit comments