Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support bool, ClassHash, ContractAddress basic types in StarknetTypedData #173

Merged
merged 103 commits into from
Apr 8, 2024

Commits on Mar 18, 2024

  1. Update StarknetExecutionResources; Add StarknetComputationResources

    - Add `dataAvailability` to `StarknetExecutionResources`; Add `StarknetDataAvailability
      - Add `executionResources` to tx traces
    - Add `StarknetComputationResources`
      - Add `computationResources` to `StarknetFunctionInvocation`
    - Add `StarknetResources` protocol with common fields
    DelevoXDG committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    cd299f8 View commit details
    Browse the repository at this point in the history
  2. Update prefund amounts and max fee for declare in DevnetClient

    - Prefund account with `5_000_000_000_000_000`->`5_000_000_000_000_000_000`
    - Change max fee in declare methods to `1_000_000_000_000_000`->`10_000_000_000_000_000`
    DelevoXDG committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    d2d94df View commit details
    Browse the repository at this point in the history
  3. Adjust tx receipt tests

    DelevoXDG committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    e012d54 View commit details
    Browse the repository at this point in the history
  4. Update StarknetFeeEstimate and related logic

    - Add `dataGasConsumed`, `dataGasPrice` fields to `StarknetFeeEstimate`
    - Update `.toResourceBounds()` extension
      - Update overheads
      - Use new logic
    DelevoXDG committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    96fc841 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    24de548 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2a36b16 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    10c1bc3 View commit details
    Browse the repository at this point in the history
  8. Bump devnet

    DelevoXDG committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    84c5dde View commit details
    Browse the repository at this point in the history

Commits on Mar 21, 2024

  1. Configuration menu
    Copy the full SHA
    db69dba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ee0a9a2 View commit details
    Browse the repository at this point in the history
  3. Add missing segment_arena_builtin to StarknetComputationResources

    … and `StarknetExecutionResources`
    
    - Adjust tests
    DelevoXDG committed Mar 21, 2024
    Configuration menu
    Copy the full SHA
    5f87f2c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1ba4133 View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2024

  1. Empty

    DelevoXDG committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    a606158 View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2024

  1. Introduce Domain and Revision

    - Add `StarknetTypedData.Domain`, `StarknetTypedData.Revision`
    - Change `domain` type: `[String: Element] -> Domain`
      - Update initializer
    - Add `getStructHash(typeName: String, data: Data)`
    - Add `getStructHash(domain: Domain)`
    DelevoXDG committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    d2bfbc8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3f0409c View commit details
    Browse the repository at this point in the history
  3. Update encode(dependency) logic in line with rev 1

    - Use correct escape chars for rev 1
    DelevoXDG committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    49031c5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c681354 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    58c0c8d View commit details
    Browse the repository at this point in the history
  6. Add rev 1 test case

    - Rename test files `typed_data_[..].json`-> `typed_data_rev_0_[..].json`
    - Add `typed_data_rev_1_example.json`
    - Update `TypedDataTests`
      - Move old td cases to `CasesRev0`
      - Add `CasesRev1`
    DelevoXDG committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    4bb69cc View commit details
    Browse the repository at this point in the history
  7. Format

    DelevoXDG committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    a32823d View commit details
    Browse the repository at this point in the history
  8. Review chnages

    DelevoXDG committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    e5f2e71 View commit details
    Browse the repository at this point in the history
  9. Review changes

    DelevoXDG committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    b894924 View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2024

  1. Configuration menu
    Copy the full SHA
    19e5338 View commit details
    Browse the repository at this point in the history
  2. Add MerkleTree

    DelevoXDG committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    efee210 View commit details
    Browse the repository at this point in the history
  3. Format

    DelevoXDG committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    1ac7a1f View commit details
    Browse the repository at this point in the history
  4. Fix tests

    DelevoXDG committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    b0d94a2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0006110 View commit details
    Browse the repository at this point in the history
  6. Add MerkleTreeType, StandardType; Convert TypeDeclaration to pr…

    …otocol
    
    - Add `TypeDeclarationWrapper`
    - Change `types` type from `[String: [TypeDeclaration]]` to `[String: [TypeDeclarationWrapper]]`
    DelevoXDG committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    371fac7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    cb2dd71 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    89c4d7e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f38cc0d View commit details
    Browse the repository at this point in the history
  10. Support merkletree basic type in StarknetTypedData

    - Tests
      - Update `typed_data_rev_0_validate_example.json` to contain
      `merkletree`; Update related test cases
      - Add `typed_data_rev_0_struct_merkletree_example.json` and `typed_data_rev_1_felt_merkletree_example.json` and related test cases
    DelevoXDG committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    1d3f8e9 View commit details
    Browse the repository at this point in the history
  11. Split testSignTypedData into rev 0 and 1 tests

    - Rename `testSignTypedData`->``testSignTypedDataRev0`; Update path to example
    - Add `testSignTypedDataRev1`
    DelevoXDG committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    6822784 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    1a19f30 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    e330ede View commit details
    Browse the repository at this point in the history
  14. Review changes

    DelevoXDG committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    403bffc View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    39f671e View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2024

  1. Configuration menu
    Copy the full SHA
    481872c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a939de5 View commit details
    Browse the repository at this point in the history
  3. Review changes

    DelevoXDG committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    1ed2e32 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2ec8d5d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2890b67 View commit details
    Browse the repository at this point in the history
  6. Refactor verifyTypes()

    - Make initializers throwing instead of failable
    - Add new `StarknetTypedDataError` variants: `basicTypeRedefinition` and `invalidTypeName`
    - Refactor `verifyTypes()`
      - Throw errors instead of just returning `false`
      - Prevent `*` in every type name, not just `felt*`
    - Override decoding initializer to esnure call to `verifyTypes()`
    DelevoXDG committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    5673e04 View commit details
    Browse the repository at this point in the history
  7. Restrict empty names; Refactor tests

    - Update `verifyTypes()` to disallow empty names
    - Make `StarknetTypedDataError` equatable to allow tests on specific throws
    - Remove `testInvalidTypeNames`; Add:
      - `testInvalidTypeNames`
      - `testTypesRedifintion`
    DelevoXDG committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    0716893 View commit details
    Browse the repository at this point in the history
  8. Refactor revision related logic

    - Make `Domain.resolveRevision` to be throwing instead of returning null
    - Use `try!` in `revision` computated expr
    DelevoXDG committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    6c2ceaa View commit details
    Browse the repository at this point in the history
  9. Require domain type; Refactor tests

    - Add check to `verifyTypes()`
    - Add `separatorName` to `Domain`
    - Refactor tests
      - Add `testMissingDomainType`
      - Take `revision` arg in `makeTypedData()`
      - Add domain type when creating typed data
    DelevoXDG committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    e0cb126 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    350cadd View commit details
    Browse the repository at this point in the history
  11. Disallow dangling types in verifyTypes()

    - Add `danglingType` error
    DelevoXDG committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    5b061d9 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    ddbfecb View commit details
    Browse the repository at this point in the history
  13. Add extra info to StarknetTypedDataError errors

    - Update
      - invalidRevision(Felt)
      - basicTypeRedefinition(String)
      - invalidTypeName(String)
    - Update `resolveRevision()` to throw `decodingError` on non-felt `Element`
    - Minor duplication removal in `verifyTypes`
    DelevoXDG committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    1ea8094 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    495a06e View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    7206647 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    c6c4e79 View commit details
    Browse the repository at this point in the history
  17. Bump swift version to 5.10.0

    - Format using `swiftformat`
    DelevoXDG committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    a8eced5 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    b093f02 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    5600de2 View commit details
    Browse the repository at this point in the history
  20. Bump swift version to 5.10.0

    - Format using `swiftformat`
    DelevoXDG committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    b8390f9 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    81fa2f3 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    d8caa2f View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    4c27593 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    5db449a View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    e5486a5 View commit details
    Browse the repository at this point in the history
  26. Format

    DelevoXDG committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    2891c5a View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    5a197d7 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    43fbb0d View commit details
    Browse the repository at this point in the history
  29. Setup Xcode 15.3

    DelevoXDG committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    04c743c View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2024

  1. Refactor array hanlding logic

    Allow handle both basic and struct arrays in one block
    DelevoXDG committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    3096f02 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ee05381 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d09d6d9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a407d21 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    503509c View commit details
    Browse the repository at this point in the history
  6. Support bool basic type

    - Change visibility for `encode()` and `StarknetTypedData` extensions from `private` to `internal` to allow unit tests
    DelevoXDG committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    8302000 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6e7358b View commit details
    Browse the repository at this point in the history
  8. Update verifyTypes() to include bool and all rev 1 basic types

    - Refactor related logic
      - Add `basicTypesV0` and `basicTypesV1` as static sets in extension
      - Avoid nested list loops in `verifyTypes()`
    DelevoXDG committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    25260c3 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b1f1ee9 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c015793 View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2024

  1. Configuration menu
    Copy the full SHA
    9feaf94 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    090763c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    932790c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    47563a9 View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2024

  1. Add testEncodeType

    - Make `encode(type: String)` internal
    DelevoXDG committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    606a2bf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ddce0c3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3e0a5da View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8966f27 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0b9a346 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e8f8e20 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e2e3002 View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2024

  1. Configuration menu
    Copy the full SHA
    093113d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d426775 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ed61f7a View commit details
    Browse the repository at this point in the history
  4. Make revision public

    DelevoXDG committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    daf429b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    947ebd6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1d61523 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    759afd0 View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2024

  1. Configuration menu
    Copy the full SHA
    e201759 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    28b288e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0ef4417 View commit details
    Browse the repository at this point in the history
  4. Fix merge anomaly

    DelevoXDG committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    5ebfeac View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4c0b593 View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2024

  1. Configuration menu
    Copy the full SHA
    b1642be View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f903902 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2b5eefc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a0118c1 View commit details
    Browse the repository at this point in the history