Summary
Follow up on the Ethereum display-format definition support introduced in #7304 after the firmware freeze.
Required changes
- Revisit the Trezorlib Ethereum signing API so the definition-request handling is internalized around a
definitions.Source (or an equivalent source abstraction), rather than requiring callers to supply a definition_provider callback that only dispatches request fields to Source lookup methods.
- Simplify the tar definition-source implementation by removing root-prefix detection and the detailed diagnostic handling for the unsupported tarball case, as agreed in the review discussion.
Rationale
Source already abstracts definition retrieval and can serve repeated, nested lookup requests. Moving the protocol-specific callback dispatch into the library should make the public signing API clearer and avoid duplicating the same callback logic in Trezorlib consumers.
Affected areas
python/src/trezorlib/ethereum.py signing API and definition-request flow
python/src/trezorlib/cli/ethereum.py CLI definition wiring
python/src/trezorlib/definitions.py tar definition source behavior
Acceptance criteria
- Ethereum signing callers can provide a definition source without implementing a boilerplate request-dispatch callback.
- Repeated and nested definition requests remain supported.
- Tar source root detection and the agreed detailed unsupported-tarball diagnostics are removed or replaced by the simplified intended behavior.
- Relevant tests cover the finalized API and tar-source behavior.
Backlinks
Requested by: @PrisionMike
Summary
Follow up on the Ethereum display-format definition support introduced in #7304 after the firmware freeze.
Required changes
definitions.Source(or an equivalent source abstraction), rather than requiring callers to supply adefinition_providercallback that only dispatches request fields toSourcelookup methods.Rationale
Sourcealready abstracts definition retrieval and can serve repeated, nested lookup requests. Moving the protocol-specific callback dispatch into the library should make the public signing API clearer and avoid duplicating the same callback logic in Trezorlib consumers.Affected areas
python/src/trezorlib/ethereum.pysigning API and definition-request flowpython/src/trezorlib/cli/ethereum.pyCLI definition wiringpython/src/trezorlib/definitions.pytar definition source behaviorAcceptance criteria
Backlinks
Requested by: @PrisionMike