Skip to content

Commit

Permalink
fix: fix trusted names sources (#125)
Browse files Browse the repository at this point in the history
`sources` are now free form strings since LedgerHQ/clear-signing-erc7730-registry#23
  • Loading branch information
jnicoulaud-ledger authored Oct 29, 2024
1 parent 4a3b347 commit 445f2f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
13 changes: 0 additions & 13 deletions src/erc7730/model/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,6 @@ class AddressNameType(str, Enum):
"""Address is a well known NFT collection."""


class AddressNameSources(str, Enum):
"""
Trusted Source for names.
"""

LOCAL = "local"
"""Address MAY be replaced with a local name trusted by user. Wallets MAY consider that local setting for sources
is always valid."""

ENS = "ens"
"""Address MAY be replaced with an associated ENS domain."""


class Screen(RootModel[dict[str, Any]]):
"""
Screens section is used to group multiple fields to display into screens. Each key is a wallet type name. The
Expand Down
7 changes: 3 additions & 4 deletions src/erc7730/model/input/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from erc7730.model.base import Model
from erc7730.model.display import (
AddressNameSources,
AddressNameType,
DateEncoding,
FieldFormat,
Expand Down Expand Up @@ -105,11 +104,11 @@ class InputAddressNameParameters(Model):
min_length=1,
)

sources: list[AddressNameSources] | DescriptorPathStr | None = Field(
sources: list[str] | DescriptorPathStr | None = Field(
default=None,
title="Trusted Sources",
description="An array of acceptable sources for names (see next section). If set, the wallet SHOULD restrict "
"name lookup to relevant sources.",
description="An array of acceptable sources for names. If set, the wallet SHOULD restrict name lookup to "
"relevant sources.",
min_length=1,
)

Expand Down
7 changes: 3 additions & 4 deletions src/erc7730/model/resolved/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from erc7730.model.base import Model
from erc7730.model.display import (
AddressNameSources,
AddressNameType,
DateEncoding,
FieldFormat,
Expand Down Expand Up @@ -66,11 +65,11 @@ class ResolvedAddressNameParameters(Model):
min_length=1,
)

sources: list[AddressNameSources] | None = Field(
sources: list[str] | None = Field(
default=None,
title="Trusted Sources",
description="An array of acceptable sources for names (see next section). If set, the wallet SHOULD restrict "
"name lookup to relevant sources.",
description="An array of acceptable sources for names. If set, the wallet SHOULD restrict name lookup to "
"relevant sources.",
min_length=1,
)

Expand Down

0 comments on commit 445f2f8

Please sign in to comment.