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

feat(docs): Expand web3 config guide #7131

Merged
merged 58 commits into from
Aug 6, 2024

Conversation

mmyyrroonn
Copy link
Contributor

@mmyyrroonn mmyyrroonn commented Jun 27, 2024

Description

Fix #6805

This PR expands the web3 config guide, including a detailed explanation for each config property and the code snippet.

  • transactionConfirmationPollingInterval is marked as deprecated since I found it useless after this commit and cannot be found in the whole repo right now. Please correct me if I miss anything.
  • The default value of contractDataInputFill in the API doc is changed to data from input.
  • Add one more property defaultMaxPriorityFeePerGas.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run lint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success.
  • I ran npm run test:coverage and my test cases cover all the lines and branches of the added code.
  • I ran npm run build and tested dist/web3.min.js in a browser.
  • I have tested my code on the live network.
  • I have checked the Deploy Preview and it looks correct.
  • I have updated the CHANGELOG.md file in the root folder.
  • I have linked Issue(s) with this PR in "Linked Issues" menu.

@mmyyrroonn mmyyrroonn force-pushed the fix-6805-expand-web3config-guide-doc branch from 006213d to 098a245 Compare June 27, 2024 01:31
@mmyyrroonn
Copy link
Contributor Author

@avkos @jdevcs Hi, could you please take a review when you're free? 😄 Thank you so much for your attention.

docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
@mmyyrroonn mmyyrroonn requested a review from jdevcs July 29, 2024 02:23
Copy link
Contributor

@danforbes danforbes left a comment

Choose a reason for hiding this comment

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

Great contributions! Just a few more suggestions and we should be good to go. Thank you so much 🙏🏻

Comment on lines 243 to 251
```ts
import { Web3 } from 'web3';

const web3 = new Web3('http://127.0.0.1:7545');

web3.defaultAccount = undefined;

console.log(web3.getContextObject().config);
```
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand the benefit of these code blocks - they seem repetitive and don't communicate any new information to the reader. I would prefer to get rid of most of them (I will make note of the instances where I think it would make sense to keep them).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with you. The original requirement of the issue was to add an example for each config property. Initially, I used a value different from the default to demonstrate other options. However, during the first round of review, it was requested that we use the default value instead. Now, it seems redundant to me as well.

docs/docs/guides/web3_config/index.md Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
@mmyyrroonn
Copy link
Contributor Author

@danforbes Hi, I resolved the review comments. All examples are removed except for the transactionPollingInterval, defaultReturnFormat and defaultCommon.

docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
docs/docs/guides/web3_config/index.md Outdated Show resolved Hide resolved
@mmyyrroonn
Copy link
Contributor Author

@danforbes Thanks for those suggestions so much 😄. I'm not a native speaker and I appreciate it. I only left one question to discuss

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

Successfully merging this pull request may close these issues.

Expand web3config guide [docs]
6 participants