Skip to content

Replace deprecated stellar contract bindings json with stellar contract info interface#112

Open
bbyalcinkaya wants to merge 10 commits into
masterfrom
fix-bindings
Open

Replace deprecated stellar contract bindings json with stellar contract info interface#112
bbyalcinkaya wants to merge 10 commits into
masterfrom
fix-bindings

Conversation

@bbyalcinkaya

@bbyalcinkaya bbyalcinkaya commented Apr 17, 2026

Copy link
Copy Markdown
Member

The stellar contract bindings json command has been deprecated.
Switch to stellar contract info interface --output json for extracting contract interfaces from Wasm (Stellar CLI Manual).

The new command returns the interface in XDR-JSON format.
Update the parsing logic to consume this format and adapt type decoding accordingly.

No functional change in Komet’s internal representation; only the input format and extraction method are updated.

Note: Unit tests in CI run outside Docker and without kompilation, so some refactoring was needed to prevent KDefinitions from being loaded during Python module import. Reviewing commit by commit may be easier, since the PR includes both the interface migration and the related test/import refactoring.

@bbyalcinkaya bbyalcinkaya marked this pull request as ready for review April 23, 2026 12:19

@juliankuners juliankuners left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments, otherwise LGTM

Comment thread src/komet/scval.py Outdated
def _from_dict(cls: type[SCVecType], d: dict[str, Any]) -> SCVecType:
return SCVecType(SCType.from_dict(d['element']))
def _from_xdr_json(cls: type[SCVecType], x: str | dict[str, Any]) -> SCVecType:
assert isinstance(x, dict)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a ValueError.

Comment thread src/komet/scval.py Outdated
key = SCType.from_dict(d['key'])
value = SCType.from_dict(d['value'])
def _from_xdr_json(cls: type[SCMapType], x: str | dict[str, Any]) -> SCMapType:
assert isinstance(x, dict)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also ValueError instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants