Commit 8ce7035
Allow
* Differentiate typed data files by revision
* Add `HashMethod`
* Add `Revision` enum; Rename `StarkNetDomain` to `Domain`
* Add tests to revision 1
* Remove prints
* Add more rev 1 test cases to `test_type_hash`
* Change values param to `List[int]` in `HashMethod.hash()`
* Add `DomainSchema`; Add `RevisionField` and `ChainIdField`
* Move `HashMethod` to separate file
* Refactor `Domain.to_dict()`
* Update comment
* Add `TypedData._hash_method` field
* Remove `TypedData._hash_method` field
* Update docs
* Update docs
* Update comment
* Reduce `Domain._verify_types()`
* Remove unnecessary variable duplication
* Remove unused functions
* Convert `TypedData._hash_method` to `@property`
* Change `Domain.revision` type to `Revision`
* Use equality comparison for `resolved_revision`
* Set `revision` in `Domain` typed dict to be `Optional`
* Update import
* Refactor `Domain.to_dixt()`
* Fix doc examples for `sign_message` and `verify_message`; Update function descriptions
* Remove unused import
* Remove `test_sign_message_rev_v0` and `test_verify_message_rev_v0`
* Change `sign_message()` and `verify_message()` to accept `TypedData` dataclass
* Update migration guide
* Update `test_sign_offchain_message()` to use `TypedData` class instance
* Update previous changes in `sign_message()` and `verify_message()`
* Update `sign_message()` and `verify_message()` description comments
* Minor `DomainSchema.make_dataclass()` refactor
* Restore retrieving `revision` using `data.get()`
* Add missing type annotation in `test_invalid_types()`
* Update `RevisionField._deserialize()` return type to `Revision`
* Add custom error message on missing value in `Revision` enum
* Add module in migration guide to enable hyperlinks
* Check error message in `test_invalid_types`
* Add `Parameter.to_dict()` and `TypedData.to_dict()`
* Move `Revision` to common schemas
* Format
* Set `ChainIdField._deserialize()` return type to `str`; Change 'DomainDict.chainId' type to `str`
* Remove unnecessary import
* Restore previous import of `keccak256`
* Format
* Add newline in typed data rev 1 example json
* Remove unnecessary `ChainIdField`
* Change chainId from `int` to `str` in all examples
* Refactor `TypedData.to_dict()`
* Remove `Parameter.to_dict()`; Add `RevisionField._serialize()`
* Update starknet_py/net/schemas/common.py
Co-authored-by: ddoktorski <45050160+ddoktorski@users.noreply.github.com>
* Update starknet_py/net/schemas/common.py
Co-authored-by: ddoktorski <45050160+ddoktorski@users.noreply.github.com>
---------
Co-authored-by: ddoktorski <45050160+ddoktorski@users.noreply.github.com>TypedData revision 1 (#1360)1 parent 56c60c1 commit 8ce7035
File tree
16 files changed
+371
-55
lines changed- docs
- api
- starknet_py
- hash
- net
- account
- models
- schemas
- tests/e2e
- docs
- code_examples
- guide
- fixtures
- mock/typed_data
- utils
16 files changed
+371
-55
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
4 | 22 | | |
5 | 23 | | |
6 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
321 | 322 | | |
322 | 323 | | |
323 | 324 | | |
| |||
327 | 328 | | |
328 | 329 | | |
329 | 330 | | |
| 331 | + | |
330 | 332 | | |
331 | 333 | | |
332 | 334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | | - | |
| 19 | + | |
18 | 20 | | |
19 | | - | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | | - | |
| 37 | + | |
35 | 38 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
336 | 337 | | |
337 | 338 | | |
338 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
0 commit comments