Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions xrpl/models/transactions/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def _key_to_tx_json(key: str) -> str:
def _value_to_tx_json(value: XRPL_VALUE_TYPE) -> XRPL_VALUE_TYPE:
# IssuedCurrencyAmount and PathStep are special cases and should not be snake cased
# and only contain primitive members
if isinstance(value, dict) and "auth_account" in value:
return _auth_account_value_to_tx_json(value)
if IssuedCurrencyAmount.is_dict_of_model(value) or PathStep.is_dict_of_model(value):
return value
if isinstance(value, dict):
Expand All @@ -69,6 +71,13 @@ def _value_to_tx_json(value: XRPL_VALUE_TYPE) -> XRPL_VALUE_TYPE:
return value


def _auth_account_value_to_tx_json(value: Dict[str, Any]) -> Dict[str, Any]:
return {
_key_to_tx_json(key): transaction_json_to_binary_codec_form(val)
for (key, val) in value.items()
}


@require_kwargs_on_init
@dataclass(frozen=True)
class Memo(BaseModel):
Expand Down