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

docs: re-introduce testing wallets docs #2635

Conversation

maschad
Copy link
Member

@maschad maschad commented Jun 26, 2024

Summary

This PR documents how we can test using launchTestNode and Wallet.generate to generate wallets with different balances and assets for testing.

I've created this as a separate PR from #2811 to make the review process a bit easier.

Checklist

  • I addedtests to prove my changes
  • I updated — all the necessary docs
  • I reviewed — the entire PR myself, using the GitHub UI
  • I described — all breaking changes and the Migration Guide

@maschad maschad self-assigned this Jun 26, 2024
@github-actions github-actions bot added the docs Requests pertinent to documentation label Jun 26, 2024
@maschad maschad marked this pull request as draft June 26, 2024 21:17
@maschad maschad marked this pull request as ready for review June 26, 2024 21:36
Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
80.29%(+0%) 71.8%(+0%) 77.56%(+0%) 80.36%(+0%)
Changed Files:

Coverage values did not change👌.

@nedsalk
Copy link
Contributor

nedsalk commented Jun 27, 2024

I'm concerned that we are sending conflicting messages between this and launchTestNode. Anybody who was using generateTestWallet in tests should switch to launchTestNode, and anybody who was using it in app code (like in #2617) was misusing the utility. For example, the generateTestWallet utility depends on process.env.GENESIS_SECRET, an environment variable created to solve the flakiness around double spending in our tests, etc. - it wasn't designed with app/production code in mind.

If the users have a need for such an utility, we should think about how best to give them access to it. Perhaps it's not a new utility at all, but just some documentation around Wallet.generate and how it can be integrated with a custom-made stateConfig.json - something that can be put in the cookbook.

@maschad
Copy link
Member Author

maschad commented Jun 27, 2024

I'm concerned that we are sending conflicting messages between this and launchTestNode. Anybody who was using generateTestWallet in tests should switch to launchTestNode, and anybody who was using it in app code (like in #2617) was misusing the utility. For example, the generateTestWallet utility depends on process.env.GENESIS_SECRET, an environment variable created to solve the flakiness around double spending in our tests, etc. - it wasn't designed with app/production code in mind.

I agree with you that launchTestNode is a better utility, when I created this PR I hadn't found any documentation around retrieving the wallet instance, so I still felt that generateTestWallet would be useful until that was better elucidated. Reading this now I think it suffices. Perhaps I should just highlight it here.

If the users have a need for such an utility, we should think about how best to give them access to it. Perhaps it's not a new utility at all, but just some documentation around Wallet.generate and how it can be integrated with a custom-made stateConfig.json - something that can be put in the cookbook.

This documentation around Wallet.generate outlines that so I think it's useful. Perhaps we can give a recommendation to use launchTestNode as the preface on this guide, but also highlight that if a user needs to specifically just generate a wallet that can be done via this snippet.

@maschad maschad marked this pull request as draft June 29, 2024 23:34
@maschad maschad added the blocked label Jul 1, 2024
@maschad
Copy link
Member Author

maschad commented Jul 1, 2024

Whilst refactoring fuel-gauge to use launchTestNode, I've realized there are some relevant use cases that I will document in #2579 in relation to wallet generation and instantiation which the new test-wallet docs can benefit from. So I will revisit this PR after that.

@maschad maschad removed the blocked label Aug 8, 2024
@maschad maschad changed the base branch from master to mc/chore/integrate-launch-test-node-in-remaining-packages August 8, 2024 00:27
…es' into mc/docs/reintroduce-wallet-testing-docs
…es' into mc/docs/reintroduce-wallet-testing-docs
…es' into mc/docs/reintroduce-wallet-testing-docs
…es' into mc/docs/reintroduce-wallet-testing-docs
@maschad maschad merged commit c471267 into mc/chore/integrate-launch-test-node-in-remaining-packages Aug 10, 2024
17 checks passed
@maschad maschad deleted the mc/docs/reintroduce-wallet-testing-docs branch August 10, 2024 21:13
petertonysmith94 added a commit that referenced this pull request Aug 15, 2024
* refactor: integrated launchTestNode in remaining files

* docs: update changeset

* test: integrated launchTestNode into all tests excluding doc-snippets

* wip

* test: refactored many tests in docs-snippets

* test: skipping currently failing test suites for ci tests

* docs: add changeset

* deps: update dependencies

* deps: remove cyclical dependency

* deps: updated dependencies to use setupTestWallet for now

* fix: add error handling for in memory store historical view issues

* test: enable browser for demo-fuels index test

* docs: added comments about typegen contract call mismatches

* revert error supression on provider

* test: increasing block production time

* test: browser test adjusments

* test: browser test adjustments

* test: update provider test case for snippets

* chore: refactor to use new typegen types

* linting

* chore: resolve issue with account tests

* chore: undo create-fuels.js change

* chore: update poa-interval-period

* chore: update querying chain docs tests

* test: update FUEL_CORE compatability tests

* linting fixes

* docs: use custom port for launchTestNode

* docs: update docs with PR feedback

* chore: remove unused testing utilities

* chore: more PR feedback refactors

* ci: update CI workflow test scripts

* ci: update workflow steps

* test: update tests to spin up temp nodes in setup

* linting

* docs: update changesets

Co-authored-by: Peter Smith <[email protected]>

* chore: update variable assignment

Co-authored-by: Peter Smith <[email protected]>

* docs: update imports

Co-authored-by: Peter Smith <[email protected]>

* chore: pr feedback changes

* docs: re-introduce testing wallets docs (#2635)

Co-authored-by: Anderson Arboleya <[email protected]>

* chore: update changesets + feedback

* ci: remove unnecessary clean step

* docs: update contributing docs

* chore: update test asset IDs

* chore: refactor account tests to use helper

* chore: pr feedback

* docs: update changesets

* docs: update changeset to breaking

* docs: remove unnecessary updates from changeset

---------

Co-authored-by: Sérgio Torres <[email protected]>
Co-authored-by: Peter Smith <[email protected]>
Co-authored-by: Anderson Arboleya <[email protected]>
petertonysmith94 added a commit that referenced this pull request Aug 15, 2024
* refactor: integrated launchTestNode in remaining files

* docs: update changeset

* test: integrated launchTestNode into all tests excluding doc-snippets

* wip

* test: refactored many tests in docs-snippets

* test: skipping currently failing test suites for ci tests

* docs: add changeset

* deps: update dependencies

* deps: remove cyclical dependency

* deps: updated dependencies to use setupTestWallet for now

* fix: add error handling for in memory store historical view issues

* test: enable browser for demo-fuels index test

* docs: added comments about typegen contract call mismatches

* revert error supression on provider

* test: increasing block production time

* test: browser test adjusments

* test: browser test adjustments

* test: update provider test case for snippets

* chore: refactor to use new typegen types

* linting

* chore: resolve issue with account tests

* chore: undo create-fuels.js change

* chore: update poa-interval-period

* chore: update querying chain docs tests

* test: update FUEL_CORE compatability tests

* linting fixes

* docs: use custom port for launchTestNode

* docs: update docs with PR feedback

* chore: remove unused testing utilities

* chore: more PR feedback refactors

* ci: update CI workflow test scripts

* ci: update workflow steps

* test: update tests to spin up temp nodes in setup

* linting

* docs: update changesets

Co-authored-by: Peter Smith <[email protected]>

* chore: update variable assignment

Co-authored-by: Peter Smith <[email protected]>

* docs: update imports

Co-authored-by: Peter Smith <[email protected]>

* chore: pr feedback changes

* docs: re-introduce testing wallets docs (#2635)

Co-authored-by: Anderson Arboleya <[email protected]>

* chore: update changesets + feedback

* ci: remove unnecessary clean step

* chore: deprecated urls

* chore: changeset

* docs: update contributing docs

* chore: update test asset IDs

* Update network url

* chore: refactor account tests to use helper

* chore: pr feedback

* docs: update changesets

* docs: update changeset to breaking

* docs: remove unnecessary updates from changeset

* chore: removed `FUEL_NETWORK_URL` env

* chore: updated pvt key envs

* chore: changeset

---------

Co-authored-by: chad <[email protected]>
Co-authored-by: Sérgio Torres <[email protected]>
Co-authored-by: Anderson Arboleya <[email protected]>
maschad added a commit that referenced this pull request Aug 21, 2024
* refactor: integrated launchTestNode in remaining files

* docs: update changeset

* test: integrated launchTestNode into all tests excluding doc-snippets

* wip

* test: refactored many tests in docs-snippets

* test: skipping currently failing test suites for ci tests

* docs: add changeset

* deps: update dependencies

* deps: remove cyclical dependency

* deps: updated dependencies to use setupTestWallet for now

* fix: add error handling for in memory store historical view issues

* test: enable browser for demo-fuels index test

* docs: added comments about typegen contract call mismatches

* revert error supression on provider

* test: increasing block production time

* test: browser test adjusments

* test: browser test adjustments

* test: update provider test case for snippets

* chore: refactor to use new typegen types

* linting

* chore: resolve issue with account tests

* chore: undo create-fuels.js change

* chore: update poa-interval-period

* chore: update querying chain docs tests

* test: update FUEL_CORE compatability tests

* linting fixes

* docs: use custom port for launchTestNode

* docs: update docs with PR feedback

* chore: remove unused testing utilities

* chore: more PR feedback refactors

* ci: update CI workflow test scripts

* ci: update workflow steps

* test: update tests to spin up temp nodes in setup

* linting

* docs: update changesets

Co-authored-by: Peter Smith <[email protected]>

* chore: update variable assignment

Co-authored-by: Peter Smith <[email protected]>

* docs: update imports

Co-authored-by: Peter Smith <[email protected]>

* chore: pr feedback changes

* docs: re-introduce testing wallets docs (#2635)

Co-authored-by: Anderson Arboleya <[email protected]>

* chore: update changesets + feedback

* ci: remove unnecessary clean step

* docs: update contributing docs

* chore: update test asset IDs

* chore: refactor account tests to use helper

* chore: pr feedback

* docs: update changesets

* docs: update changeset to breaking

* docs: remove unnecessary updates from changeset

---------

Co-authored-by: Sérgio Torres <[email protected]>
Co-authored-by: Peter Smith <[email protected]>
Co-authored-by: Anderson Arboleya <[email protected]>
maschad added a commit that referenced this pull request Aug 21, 2024
* refactor: integrated launchTestNode in remaining files

* docs: update changeset

* test: integrated launchTestNode into all tests excluding doc-snippets

* wip

* test: refactored many tests in docs-snippets

* test: skipping currently failing test suites for ci tests

* docs: add changeset

* deps: update dependencies

* deps: remove cyclical dependency

* deps: updated dependencies to use setupTestWallet for now

* fix: add error handling for in memory store historical view issues

* test: enable browser for demo-fuels index test

* docs: added comments about typegen contract call mismatches

* revert error supression on provider

* test: increasing block production time

* test: browser test adjusments

* test: browser test adjustments

* test: update provider test case for snippets

* chore: refactor to use new typegen types

* linting

* chore: resolve issue with account tests

* chore: undo create-fuels.js change

* chore: update poa-interval-period

* chore: update querying chain docs tests

* test: update FUEL_CORE compatability tests

* linting fixes

* docs: use custom port for launchTestNode

* docs: update docs with PR feedback

* chore: remove unused testing utilities

* chore: more PR feedback refactors

* ci: update CI workflow test scripts

* ci: update workflow steps

* test: update tests to spin up temp nodes in setup

* linting

* docs: update changesets

Co-authored-by: Peter Smith <[email protected]>

* chore: update variable assignment

Co-authored-by: Peter Smith <[email protected]>

* docs: update imports

Co-authored-by: Peter Smith <[email protected]>

* chore: pr feedback changes

* docs: re-introduce testing wallets docs (#2635)

Co-authored-by: Anderson Arboleya <[email protected]>

* chore: update changesets + feedback

* ci: remove unnecessary clean step

* chore: deprecated urls

* chore: changeset

* docs: update contributing docs

* chore: update test asset IDs

* Update network url

* chore: refactor account tests to use helper

* chore: pr feedback

* docs: update changesets

* docs: update changeset to breaking

* docs: remove unnecessary updates from changeset

* chore: removed `FUEL_NETWORK_URL` env

* chore: updated pvt key envs

* chore: changeset

---------

Co-authored-by: chad <[email protected]>
Co-authored-by: Sérgio Torres <[email protected]>
Co-authored-by: Anderson Arboleya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Requests pertinent to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reintroduce Wallet testing documentation
5 participants