Skip to content

refactor(sdk)!: don't return Arc in SdkBuilder - #1838

Merged
QuantumExplorer merged 4 commits into
v1.0-devfrom
refactor/rs-sdk-no-arc
May 7, 2024
Merged

refactor(sdk)!: don't return Arc in SdkBuilder#1838
QuantumExplorer merged 4 commits into
v1.0-devfrom
refactor/rs-sdk-no-arc

Conversation

@lklimek

@lklimek lklimek commented May 7, 2024

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

Based on team's feedback, it's not a good idea to return Arc from SdkBuilder::build().

What was done?

Refactored the code to:

  • return Sdk from SdkBuilder::build()
  • implement Clone on Sdk and make Sdk internally thread-safe

Accompanying PR: dashpay/platform-tui#48

How Has This Been Tested?

GHA

Breaking Changes

SdkBuilder::build() now returns Sdk instead of Arc.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Comment thread packages/rs-sdk/src/sdk.rs Outdated
PlatformVersion::set_current(self.version);

let sdk= match self.addresses {
let sdk= match self.addresses {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a bit of formatting

@lklimek
lklimek requested a review from fominok May 7, 2024 09:37
fominok
fominok previously approved these changes May 7, 2024
@QuantumExplorer
QuantumExplorer merged commit 63d06f6 into v1.0-dev May 7, 2024
@QuantumExplorer
QuantumExplorer deleted the refactor/rs-sdk-no-arc branch May 7, 2024 22:23
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.

3 participants