Skip to content

Pydantic error occurred while getting transactions #43

@Sanchoyzer

Description

@Sanchoyzer
pytonapi==0.4.8

There is a Pydantic error:

from pytonapi import AsyncTonapi
ton_api_client = AsyncTonapi(api_key='...')
await ton_api_client.blockchain.get_account_transactions(account_id='EQB1QBhyiY76wtIDTaV3pFtl8jE_aCrlGeDDTRbz2LaNjWYC', before_lt=57635983000002, after_lt=None, limit=1, sort_order='desc')

The reason is that the exit_code_description field must be int | None, but it is a string:

class ComputePhase(BaseModel):
    skipped: bool
    skip_reason: Optional[ComputeSkipReason] = None
    success: Optional[bool] = None
    gas_fees: Optional[int] = None
    gas_used: Optional[int] = None
    vm_steps: Optional[int] = None
    exit_code: Optional[int] = None
    exit_code_description: Optional[int] = None
'compute_phase': {'exit_code': 0,               
                  'exit_code_description': 'Ok',
                  'gas_fees': 40000,
                  'gas_used': 62,
                  'skipped': False, 
                  'success': True, 
                  'vm_steps': 3},

P.S. It would be wonderful to update the Pydantic library to the latest version

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions