Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of depositCaching parameter for gateways #3563

Merged
merged 2 commits into from
Oct 31, 2022
Merged

Addition of depositCaching parameter for gateways #3563

merged 2 commits into from
Oct 31, 2022

Conversation

iamredbar
Copy link
Member

General

This PR adds functionality to choose whether or not a gateway allows for cached deposit addresses/memos. While being a small change (4 lines), this adds major modular improvement by allowing for gateways with unique deposit requirements. Changes have been added to each active gateway setting this parameter equal to 'true' to continue working with prior UI functionality.

Code Preparation

  • Check for unused code
  • No unrelated changes are included
  • None of the changed files are reformatting only
  • Code is self explanatory or documented
  • All written text is properly translated (english language)

Testing

The branch has been tested on the following browsers (desktop and mobile view)

  • Chrome
  • Opera
  • Firefox
  • Safari

This PR adds functionality to choose whether or not a gateway allows for cached deposit addresses/memos.
While being a small change (4 lines), this adds major modular improvement by allowing for gateways with unique deposit requirements.
Changes have been added to each active gateway setting this parameter to 'true' to continue with prior UI functionality.
@sschiessl-bcp
Copy link
Contributor

Please code it in a way that the default value of the flag is inline with existing behavior.

@iamredbar
Copy link
Member Author

Would you be able to clarify what you mean?
The default values are changed in this PR.
Do you mean if it doesn't have the flag to default to a specific value?

@sschiessl-bcp
Copy link
Contributor

You are introducing depositCaching as a new value in the gateway configuration. If this flag is not present or not set, the code should behave exactly how it did before, i.e. the default behavior of other gateways is not affected if the flag is not present.

@iamredbar
Copy link
Member Author

Thank you for the clarification. I will refactor.

- removed hard coded depositCaching properties from gateways config
- used ternary operator to evaluate if property depositCaching is present
@iamredbar
Copy link
Member Author

I have updated to comply with non-use of depositCaching property. It uses a ternary operator with the object prototype method .hasOwnProperty.

@sschiessl-bcp sschiessl-bcp merged commit 15fb676 into bitshares:develop Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants