Skip to content

Addition of depositCaching parameter for gateways#3563

Merged
sschiessl-bcp merged 2 commits intobitshares:developfrom
iamredbar:gatewayDepositCaching
Oct 31, 2022
Merged

Addition of depositCaching parameter for gateways#3563
sschiessl-bcp merged 2 commits intobitshares:developfrom
iamredbar:gatewayDepositCaching

Conversation

@iamredbar
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@iamredbar
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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