Skip to content

Commit

Permalink
SEP-6: pass all request params to process_sep6_request (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriescl authored Nov 6, 2020
1 parent 1c7934f commit ff6f3ca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion polaris/polaris/sep6/deposit.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,18 @@ def parse_request_args(request: Request) -> Dict:
except (ValueError, MemoInvalidException):
return {"error": render_error_response(_("invalid 'memo' for 'memo_type'"))}

return {
args = {
"asset": asset,
"memo_type": memo_type,
"memo": memo,
"lang": lang,
"type": request.GET.get("type"),
**extract_sep9_fields(request.GET),
}

# add remaining extra params, it's on the anchor to validate them
for param, value in request.GET.items():
if param not in args:
args[param] = value

return args
9 changes: 8 additions & 1 deletion polaris/polaris/sep6/withdraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def parse_request_args(request: Request) -> Dict:
if not request.GET.get("dest"):
return {"error": render_error_response(_("'dest' is required"))}

return {
args = {
"asset": asset,
"memo_type": memo_type,
"memo": memo,
Expand All @@ -124,6 +124,13 @@ def parse_request_args(request: Request) -> Dict:
**extract_sep9_fields(request.GET),
}

# add remaining extra params, it's on the anchor to validate them
for param, value in request.GET.items():
if param not in args:
args[param] = value

return args


def validate_response(
args: Dict, integration_response: Dict, transaction: Transaction
Expand Down

0 comments on commit ff6f3ca

Please sign in to comment.