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

use Address() API to simplify code #2749

Closed
dustinxie opened this issue Jul 29, 2021 · 1 comment · Fixed by #2751
Closed

use Address() API to simplify code #2749

dustinxie opened this issue Jul 29, 2021 · 1 comment · Fixed by #2751
Labels
good first issue Good for newcomers

Comments

@dustinxie
Copy link
Member

What would you like to be added:
replace

pubKey := prvKey.PublicKey()
addr, _ := address.FromBytes(pubKey.Hash())

with

addr := pubKey.Address()

Why is this needed:

  1. the latest go-pkgs added Address() API to directly output the Address object given the public key
  2. more concise code
@ashishsnigam
Copy link
Contributor

@dustinxie Please review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants