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

[core] Refactor ui/src/services and remove uncommon getters in BaseShop #434

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

haVincy
Copy link
Contributor

@haVincy haVincy commented Oct 29, 2022

No description provided.

@haVincy haVincy force-pushed the core/refactor-multi-chain-codes branch from 4d2e55b to 0121ef1 Compare October 29, 2022 09:05
@haVincy
Copy link
Contributor Author

haVincy commented Oct 29, 2022

Test link - https://core-refactor-multi-chain-codes.d22tqykss69onq.amplifyapp.com/
This PR is for Phase 1 refactoring, will have Phase 2 refactoring that mainly in core/sdk.

LIQ-866

core/ui
- Rename src/services to src/market, gathering the common method in
  one abstract class, named as Store.
- Decouple BlockchainType for classes declartion, using instanceof
  to check whether the instance is CandyShop or EthCandyShop and
  perform differently if needed.
- Make Auctionner as the interface to be optionally implemented.

core/sdk
- Refactor string in BlockchainType enum
- Remove uncommon getters in BaseShop and clean redundant imports.
- Move connection getter above constructor in CandyShop class
- Fix the export in shop/index.ts to expose the Model files.
@haVincy haVincy force-pushed the core/refactor-multi-chain-codes branch from 0121ef1 to 317ff48 Compare October 29, 2022 12:15
() => AuctioneerFactory({ candyShop, blockchain, wallet }),
[candyShop, blockchain, wallet]
);
const store = useMemo(() => StoreProvider({ candyShop, wallet }), [candyShop, wallet]);
Copy link
Contributor Author

@haVincy haVincy Oct 30, 2022

Choose a reason for hiding this comment

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

@beepsaidblue @vanminh1701 I was wondering if it's good that we just add check here to avoid EthCandyShop to use Auctions. What do you guys think?

if (!(candyShop instanceof CandyShop)) {
    // return something empty component
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

NVM, I just realize if the shopAddress doesn't have Auction data, it's will be empty. I think maybe no need to add this redundant codes.

@RustySol RustySol merged commit 1a286ae into master Oct 31, 2022
@RustySol RustySol deleted the core/refactor-multi-chain-codes branch November 7, 2022 03:07
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