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

[BUG] Invalid felt value when fetching signed tx on devnet #314

Closed
Arcticae opened this issue Aug 17, 2022 · 4 comments
Closed

[BUG] Invalid felt value when fetching signed tx on devnet #314

Arcticae opened this issue Aug 17, 2022 · 4 comments
Assignees

Comments

@Arcticae
Copy link
Member

Python version

3.7.12

Expected Behavior

The SDK should not crash

Current Behavior

SDK crashes, when devnet returns integer value from API for signature

Possible Solution

Extend felt type parsing logic or fix devnet logic in this case

Steps to Reproduce

  1. Sign and send the tx (i used declare)
  2. Wait for acceptance
  3. Fetch the tx

Stacktrace:


_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/Users/timelock/Library/Caches/pypoetry/virtualenvs/protostar-yi2_MPdx-py3.7/lib/python3.7/site-packages/starknet_py/net/gateway_client.py:98: in get_transaction
    return TypesOfTransactionsSchema().load(res["transaction"], unknown=EXCLUDE)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <TypesOfTransactionsSchema(many=False)>
data = {'class_hash': '0x3b9a284a7a1a59eedd5fbbd3af1281e00c3a7ea575dbc081cd19d3d495f162e', 'max_fee': '0x0', 'nonce': '0x0', 'sender_address': '0x1', ...}
many = False, partial = False, unknown = 'exclude', kwargs = {}
errors = {'signature': {0: ['Invalid value provided for felt: 34592632725506253938125844602771498483514097207169063601991873550... 1: ['Invalid value provided for felt: 1830633873577487268914590325347030490499699872026627682646826922183589844384']}}
result_data = [{'class_hash': 168492691200859081...3186263247429768750, 'hash': 282264131003291675...4050471980917027338, 'max_fee': 0, 'sender_address': 1}]
result_errors = {'signature': {0: ['Invalid value provided for felt: 34592632725506253938125844602771498483514097207169063601991873550... 1: ['Invalid value provided for felt: 1830633873577487268914590325347030490499699872026627682646826922183589844384']}}
result = [{'class_hash': 168492691200859081...3186263247429768750, 'hash': 282264131003291675...4050471980917027338, 'max_fee': 0, 'sender_address': 1}]

    def load(self, data, *, many=None, partial=None, unknown=None, **kwargs):
        errors = {}
        result_data = []
        result_errors = {}
        many = self.many if many is None else bool(many)
        if partial is None:
            partial = self.partial
        if not many:
            try:
                result = result_data = self._load(
                    data, partial=partial, unknown=unknown, **kwargs
                )
                #  result_data.append(result)
            except ValidationError as error:
                result_errors = error.normalized_messages()
                result_data.append(error.valid_data)
        else:
            for idx, item in enumerate(data):
                try:
                    result = self._load(item, partial=partial, **kwargs)
                    result_data.append(result)
                except ValidationError as error:
                    result_errors[idx] = error.normalized_messages()
                    result_data.append(error.valid_data)
    
        result = result_data
        errors = result_errors
    
        if not errors:
            return result
        else:
            exc = ValidationError(errors, data=data, valid_data=result)
>           raise exc
E           marshmallow.exceptions.ValidationError: {'signature': {0: ['Invalid value provided for felt: 3459263272550625393812584460277149848351409720716906360199187355059506361232'], 1: ['Invalid value provided for felt: 1830633873577487268914590325347030490499699872026627682646826922183589844384']}}

/Users/timelock/Library/Caches/pypoetry/virtualenvs/protostar-yi2_MPdx-py3.7/lib/python3.7/site-packages/marshmallow_oneofschema/one_of_schema.py:153: ValidationError


@cptartur
Copy link
Member

I don't think we should be fixing this since this is a devnet issue and is going to be resolved at some point.

@cptartur cptartur added the wontfix This will not be worked on label Aug 23, 2022
@Arcticae
Copy link
Member Author

Arcticae commented Sep 12, 2022

Devnet guys said that it's fixed in the new ver - can we verify it works?
0xSpaceShard/starknet-devnet#225 (comment)

@Arcticae Arcticae removed the wontfix This will not be worked on label Sep 12, 2022
@Arcticae
Copy link
Member Author

@cptartur assign as you see fit

@cptartur cptartur assigned war-in and unassigned cptartur Sep 12, 2022
@war-in
Copy link
Collaborator

war-in commented Sep 12, 2022

I've checked it and it seems that the issue no longer exists

@war-in war-in closed this as completed Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants