Skip to content

Commit e0e48a7

Browse files
Fix processing operations with default entrypoint and empty parameter (#193)
1 parent a9b7cb1 commit e0e48a7

File tree

5 files changed

+335
-20
lines changed

5 files changed

+335
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Please use [this](https://docs.gitlab.com/ee/development/changelog.html) documen
77
## Fixed
88

99
* index: Fixed processing reindexing reason saved in the database.
10+
* tzkt: Fixed processing operations with default entrypoint and empty parameter.
1011

1112
## 4.0.0 - 2021-12-24
1213

poetry.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dipdup/datasources/tzkt/datasource.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,13 @@ def convert_operation(cls, operation_json: Dict[str, Any], type_: Optional[str]
684684
originated_contract_json = operation_json.get('originatedContract') or {}
685685

686686
entrypoint, parameter = parameter_json.get('entrypoint'), parameter_json.get('value')
687-
# NOTE: TzKT returns None for `default` entrypoint
688-
if entrypoint is None and parameter_json:
689-
entrypoint = 'default'
687+
if target_json.get('address', '').startswith('KT1'):
688+
# NOTE: TzKT returns None for `default` entrypoint
689+
if entrypoint is None:
690+
entrypoint = 'default'
691+
# NOTE: Empty parameter in this case means `{"prim": "Unit"}`
692+
if parameter is None:
693+
parameter = {}
690694

691695
return OperationData(
692696
type=type_ or operation_json['type'],

0 commit comments

Comments
 (0)