Commit c3e0291
committed
Raise instead of warn when multi-sig sign types cannot be enriched
add_multi_sig_types inserts payloadMultiSigUser and outerSigner after the
hyperliquidChain entry. When sign_types has no hyperliquidChain entry it
printed a warning and returned the list unchanged, then signing carried
on with the un-enriched types.
eth_account builds the EIP-712 hash from the type list and ignores
message keys with no matching type entry, so add_multi_sig_fields still
puts payloadMultiSigUser and outerSigner into the message and they are
silently dropped from the hash. The result is a signature identical to a
plain single-signer one for the same action:
BAD = [t for t in USD_SEND_SIGN_TYPES if t["name"] != "hyperliquidChain"]
sign_multi_sig_user_signed_action_payload(w, a, False, BAD, ..., msu, outer)
== sign_user_signed_action(w, a, BAD, ..., False) # True
It carries no binding to the multi-sig user or the outer signer, so it is
not usable as an inner multi-sig signature. All of the sign types
exported from this module have hyperliquidChain first, so this only
affects callers passing their own type list, which is the case for any
action the SDK does not have a helper for yet. A stdout warning is easy
to miss there.
Raising ValueError instead. No signature that the chain accepts today
changes, since the un-enriched path could not produce one.1 parent 2fdb18f commit c3e0291
2 files changed
Lines changed: 45 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
277 | 281 | | |
278 | 282 | | |
279 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
231 | 271 | | |
232 | 272 | | |
233 | 273 | | |
| |||
0 commit comments