Skip to content

Commit 4e196ad

Browse files
bantegfubuloubu
authored andcommitted
fix: support implementation as masterCopy alias
1 parent a658b09 commit 4e196ad

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

ape_safe/client/types.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from eip712.common import SafeTxV1, SafeTxV2, create_safe_tx_def
77
from eth_pydantic_types import HexStr
88
from eth_utils import add_0x_prefix, to_hex
9-
from pydantic import BaseModel, BeforeValidator, Field, field_validator
9+
from pydantic import AliasChoices, BaseModel, BeforeValidator, Field, field_validator
1010

1111
from ape_safe.utils import get_safe_tx_hash
1212

@@ -55,7 +55,10 @@ class SafeDetails(BaseModel):
5555
nonce: int
5656
threshold: int
5757
owners: list[Address]
58-
master_copy: Address = Field(alias="masterCopy")
58+
master_copy: Address = Field(
59+
alias="masterCopy",
60+
validation_alias=AliasChoices("masterCopy", "implementation"),
61+
)
5962
modules: list[Address] = []
6063
fallback_handler: Address = Field(alias="fallbackHandler")
6164
guard: AddressType

0 commit comments

Comments
 (0)