Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add backup logic to generate keys as part of the flow #320

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

Nana-EC
Copy link
Collaborator

@Nana-EC Nana-EC commented Jul 8, 2022

Signed-off-by: Nana-EC nana@swirldslabs.com

Description:
Add backup logic to generate keys as part of the flow

Related issue(s):

Fixes #319

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Nana-EC <nana@swirldslabs.com>
@Nana-EC Nana-EC self-assigned this Jul 8, 2022
@Nana-EC Nana-EC added enhancement New feature or request P3 dev tools Features enabling dev tool integration labels Jul 8, 2022
@Nana-EC Nana-EC added this to the 0.4.0 milestone Jul 8, 2022
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 8, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov-commenter
Copy link

Codecov Report

Merging #320 (5c833c1) into main (c9b55ba) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #320   +/-   ##
=======================================
  Coverage   58.29%   58.29%           
=======================================
  Files           9        9           
  Lines         856      856           
  Branches      139      139           
=======================================
  Hits          499      499           
  Misses        325      325           
  Partials       32       32           

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 c9b55ba...5c833c1. Read the comment docs.

Copy link
Collaborator

@ar-conmit ar-conmit left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@natanasow natanasow left a comment

Choose a reason for hiding this comment

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

LGTM


const createAccountFromCompressedPublicKey = async function(compressedPublicKey) {
const transferTransaction = await (new HederaSDK.TransferTransaction()
.addHbarTransfer(HederaSDK.PublicKey.fromString(compressedPublicKey).toAccountId(0, 0), new HederaSDK.Hbar(100))
.addHbarTransfer(HederaSDK.AccountId.fromString(process.env.OPERATOR_ID_MAIN), new HederaSDK.Hbar(-100)))
.addHbarTransfer(HederaSDK.PublicKey.fromString(compressedPublicKey).toAccountId(0, 0), new HederaSDK.Hbar(10))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why decrease the initial balance from 100 to 10 HBARs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's expensive when running against remote envs.
HBAR is cheap on local-node

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Across all E2E tests we should try to keep test hbar costs as low as possible as we look to run these tests multiple times in remote envs

@Nana-EC Nana-EC merged commit 334345b into main Jul 12, 2022
@Nana-EC Nana-EC deleted the 319-dapp-key-generate branch July 12, 2022 14:08
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
dev tools Features enabling dev tool integration enhancement New feature or request P3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add key generation support to Dapp bootstrap
4 participants