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

Add AccountClaim to Metadata #1663

Merged
merged 8 commits into from
Nov 14, 2019
Merged

Add AccountClaim to Metadata #1663

merged 8 commits into from
Nov 14, 2019

Conversation

nambrot
Copy link
Contributor

@nambrot nambrot commented Nov 12, 2019

Description

This PR adds the ability for accounts to claim control of other accounts. Such claim can be verified by finding the corresponding claim in the other account's metadata.

Tested

  • Unit tests
  • e2e on namoffchainreveal

Other changes

  • Extracted common io-ts types into utils

Related issues

@nambrot nambrot self-assigned this Nov 12, 2019
@nambrot nambrot assigned mcortesi and unassigned nambrot Nov 12, 2019
Copy link
Contributor

@jmrossy jmrossy left a comment

Choose a reason for hiding this comment

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

Lgtm, just two nits below

@@ -12,4 +12,12 @@ export const privateKeyToAddress = (privateKey: string) => {
)
}

export const publicKeyToAddress = (publicKey: string) => {
return '0x' + pubToAddress(Buffer.from(publicKey.slice(2), 'hex')).toString('hex')
Copy link
Contributor

Choose a reason for hiding this comment

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

Pretty sure web3 has a util for this already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you link it? I couldn't see it in particular? Also, I think we have generally tried to avoid depending on web3 beyond web3-utils in utils

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah good point, nvm

}

export const privateKeyToPublicKey = (privateKey: string) => {
return '0x' + privateToPublic(Buffer.from(privateKey.slice(2), 'hex')).toString('hex')
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@codecov
Copy link

codecov bot commented Nov 13, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@64fb8a8). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1663   +/-   ##
=========================================
  Coverage          ?   74.26%           
=========================================
  Files             ?      277           
  Lines             ?     7617           
  Branches          ?      669           
=========================================
  Hits              ?     5657           
  Misses            ?     1845           
  Partials          ?      115
Flag Coverage Δ
#mobile 74.26% <ø> (?)

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 64fb8a8...63428b2. Read the comment docs.

@nambrot nambrot added the automerge Have PR merge automatically when checks pass label Nov 14, 2019
@mcortesi mcortesi assigned nambrot and unassigned mcortesi Nov 14, 2019
@celo-ci-bot-user celo-ci-bot-user merged commit 0049e92 into master Nov 14, 2019
@celo-ci-bot-user celo-ci-bot-user deleted the nambrot/account-claim branch November 14, 2019 22:10
aaronmgdr added a commit that referenced this pull request Nov 15, 2019
* master: (81 commits)
  Make styling more consistent in validator quick start and add password prompt to account:unlock (#1731)
  New Version for contractkit (#1727)
  Remove end-to-end attestations test from circle (#1739)
  Added helper function to get the list of current validators (#1713)
  Fix flaky end-to-end transfer, protocol unit tests (#1734)
  Add AccountClaim to Metadata (#1663)
  [Wallet] Set default gradle properties (#1629)
  Update genesis block after adding parent signatures to block header (#1732)
  Removed end-to-end-geth-integration-sync-test job in workflow (#1730)
  Change the event we emit when selecting issuers (#1706)
  [Wallet] Prompt user to restart app when turning off Forno a second time (#1708)
  Check in spanish verification translations (#1726)
  [Wallet] Style fixes on iOS for verification and backup flows (#1718)
  [Wallet] Reset isRedeemingInvite on rehydrate (#1716)
  Adjust e2e transfer and governance tests to match new fee distribution and eliminate ProposerFraction (#1585)
  [Wallet] Add more local currencies (#1698)
  Switch to correct cluster when fauceting (#1687)
  [Wallet] Use the country of the phone number for determining the default local currency (#1684)
  [Wallet] Limit QR code scanner to 1 code per second (#1676)
  Update Dark backgrounds text color (#1677)
  ...

# Conflicts:
#	packages/web/pages/_app.tsx
#	packages/web/src/dev/BuildPage.tsx
#	packages/web/src/dev/Cover.tsx
#	packages/web/src/dev/StackSection.tsx
#	yarn.lock
aaronmgdr added a commit that referenced this pull request Nov 26, 2019
* master: (70 commits)
  Make styling more consistent in validator quick start and add password prompt to account:unlock (#1731)
  New Version for contractkit (#1727)
  Remove end-to-end attestations test from circle (#1739)
  Added helper function to get the list of current validators (#1713)
  Fix flaky end-to-end transfer, protocol unit tests (#1734)
  Add AccountClaim to Metadata (#1663)
  [Wallet] Set default gradle properties (#1629)
  Update genesis block after adding parent signatures to block header (#1732)
  Removed end-to-end-geth-integration-sync-test job in workflow (#1730)
  Change the event we emit when selecting issuers (#1706)
  [Wallet] Prompt user to restart app when turning off Forno a second time (#1708)
  Check in spanish verification translations (#1726)
  [Wallet] Style fixes on iOS for verification and backup flows (#1718)
  [Wallet] Reset isRedeemingInvite on rehydrate (#1716)
  Adjust e2e transfer and governance tests to match new fee distribution and eliminate ProposerFraction (#1585)
  [Wallet] Add more local currencies (#1698)
  Switch to correct cluster when fauceting (#1687)
  [Wallet] Use the country of the phone number for determining the default local currency (#1684)
  [Wallet] Limit QR code scanner to 1 code per second (#1676)
  Update Dark backgrounds text color (#1677)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Have PR merge automatically when checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Users should be able to claim other addresses
4 participants