Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

feat: implement wallet import #2492

Merged
merged 39 commits into from
Jul 21, 2020
Merged

Conversation

brenopolanski
Copy link
Contributor

@brenopolanski brenopolanski commented Jul 17, 2020

Summary

Task: Implement Wallet Import

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@ghost ghost added Complexity: High More than 256 lines changed. Type: Feature The issue is a request for new functionality. labels Jul 17, 2020
@brenopolanski brenopolanski marked this pull request as draft July 17, 2020 16:31
@codecov
Copy link

codecov bot commented Jul 17, 2020

Codecov Report

Merging #2492 into 3.0-react will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##           3.0-react     #2492     +/-   ##
=============================================
  Coverage     100.00%   100.00%             
=============================================
  Files             24       266    +242     
  Lines            142      2698   +2556     
  Branches          18       494    +476     
=============================================
+ Hits             142      2698   +2556     
Flag Coverage Δ
#unit 100.00% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/app/components/Button/Button.tsx 100.00% <ø> (ø)
src/app/components/Card/CardControl.tsx 100.00% <ø> (ø)
src/app/App.tsx 100.00% <100.00%> (ø)
src/app/components/Address/Address.tsx 100.00% <100.00%> (ø)
src/app/components/Alert/Alert.tsx 100.00% <100.00%> (ø)
src/app/components/Avatar/Avatar.tsx 100.00% <100.00%> (ø)
src/app/components/Badge/Badge.styles.ts 100.00% <100.00%> (ø)
src/app/components/Badge/Badge.tsx 100.00% <100.00%> (ø)
src/app/components/Breadcrumbs/Breadcrumbs.tsx 100.00% <100.00%> (ø)
src/app/components/Button/Button.styles.ts 100.00% <100.00%> (ø)
... and 288 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 181f7dd...34f7f16. Read the comment docs.

@brenopolanski brenopolanski marked this pull request as ready for review July 19, 2020 12:41
Copy link
Member

@alexbarnsley alexbarnsley left a comment

Choose a reason for hiding this comment

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

nothing major that I can see. Possibly just the validation of address imports


return useMemo(() => {
if (env) {
return env.availableNetworks().map((network) => network);
Copy link
Member

Choose a reason for hiding this comment

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

is the map required since it returns itself? 🤔

Copy link
Contributor Author

@brenopolanski brenopolanski Jul 20, 2020

Choose a reason for hiding this comment

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

@alexbarnsley what do you think about returning?

name: `${network.ticker()} - ${network.name()}`,
icon: `${network.coin().charAt(0).toUpperCase()}${network.coin().slice(1).toLowerCase()}`,
coin: network.coin(),
network: network.name().toLowerCase(),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexbarnsley I updated the hook: f8f4ce6

@@ -43,106 +77,119 @@ const ImportWallet = ({ networks, onSubmit }: Props) => {
// TODO: Change to InputAddress
<FormField name="address">
<FormLabel label="Address" />
<Input data-testid="import-wallet__address-input" ref={register} />
<Input ref={register({ required: "Address is required" })} data-testid="ImportWallet__address-input" />
Copy link
Member

Choose a reason for hiding this comment

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

It might be worth incorporating the InputAddres now, as I think additional validation is required here, I get an error in the console if I put an invalid address. Or if it's ok with @faustbrian, do another PR next with that component and then update it here

Copy link
Contributor Author

@brenopolanski brenopolanski Jul 20, 2020

Choose a reason for hiding this comment

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

Yeah! I can send another PR and update this 👍

@faustbrian faustbrian merged commit 0a3f1fe into 3.0-react Jul 21, 2020
@ghost ghost deleted the feat/implement-wallet-import branch July 21, 2020 02:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Complexity: High More than 256 lines changed. Type: Feature The issue is a request for new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants