You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
↪ ipython
/usr/lib/python3.10/site-packages/IPython/core/interactiveshell.py:949: UserWarning: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
warn(
Python 3.10.1 (main, Dec 18 2021, 23:53:45) [GCC 11.1.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.31.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: %pdb
Automatic pdb calling has been turned ON
In [2]: from xrpl.clients import JsonRpcClient
In [3]: c = JsonRpcClient("https://s.altnet.rippletest.net:51234")
In [4]: from xrpl.models.requests import Ledger
In [5]: resp = c.request(Ledger(ledger_index=24971037, binary=True))
In [6]: resp
Out[6]: Response(status=<ResponseStatus.SUCCESS: 'success'>, result={'ledger': {'closed': True, 'ledger_data': '017D071D0163451A1E1577A3C28993D78514B970FB26919047661D842B2656D5301A1BF4C28A416C30DF76055CACBC703606B15684947BB51FECAA394EDCC71259900498A21AA8901C076664F1AF645987C24A6AAE23BB2936A5281A78E75A800A8BE5C5D97A4B6FE6E82745298E3A23298E3A240A00'}, 'ledger_hash': '1D4838E7515B20EDDBC7F68386797FEC2150604C423B66A3D19240756755AFE8', 'ledger_index': 24971037, 'validated': True}, id=None, type=<ResponseType.RESPONSE: 'response'>)
In [7]: from xrpl.core.binarycodec import decode
In [8]: decode(resp.result['ledger']['ledger_data'])
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-8-1f5de63ab726> in <module>
----> 1 decode(resp.result['ledger']['ledger_data'])
/tmp/xrpl/lib/python3.10/site-packages/xrpl/core/binarycodec/main.py in decode(buffer)
109 """
110 parser = BinaryParser(buffer)
--> 111 parsed_type = cast(SerializedDict, parser.read_type(SerializedDict))
112 return parsed_type.to_json()
113
/tmp/xrpl/lib/python3.10/site-packages/xrpl/core/binarycodec/binary_wrappers/binary_parser.py in read_type(self, field_type)
223 None
224 """
--> 225 return field_type.from_parser(self, None)
226
227 def read_field_value(self: BinaryParser, field: FieldInstance) -> SerializedType:
/tmp/xrpl/lib/python3.10/site-packages/xrpl/core/binarycodec/types/serialized_dict.py in from_parser(cls, parser, _length_hint)
107
108 while not parser.is_end():
--> 109 field = parser.read_field()
110 if field.name == _OBJECT_END_MARKER:
111 break
/tmp/xrpl/lib/python3.10/site-packages/xrpl/core/binarycodec/binary_wrappers/binary_parser.py in read_field(self)
208 """
209 field_header = self.read_field_header()
--> 210 field_name = definitions.get_field_name_from_header(field_header)
211 return definitions.get_field_instance(field_name)
212
/tmp/xrpl/lib/python3.10/site-packages/xrpl/core/binarycodec/definitions/definitions.py in get_field_name_from_header(field_header)
160 The name of the field described by the given FieldHeader.
161 """
--> 162 return _FIELD_HEADER_NAME_MAP[field_header]
163
164
KeyError: <xrpl.core.binarycodec.definitions.field_header.FieldHeader object at 0x7f8b649e3010>
> /tmp/xrpl/lib/python3.10/site-packages/xrpl/core/binarycodec/definitions/definitions.py(162)get_field_name_from_header()
160 The name of the field described by the given FieldHeader.
161 """
--> 162 return _FIELD_HEADER_NAME_MAP[field_header]
163
164
ipdb> field_header.field_code
1
ipdb> field_header.type_code
125
The text was updated successfully, but these errors were encountered:
xrpl-py 1.3.0
The text was updated successfully, but these errors were encountered: