- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 28
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: Update memoryClient jsdoc #1234
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: f18e9a5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Warning Review failedThe pull request is closed. WalkthroughThe changes introduce extensive enhancements to the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @roninjin10 and the rest of your teammates on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- .changeset/large-zoos-knock.md (1 hunks)
- packages/memory-client/src/MemoryClient.ts (2 hunks)
- packages/memory-client/src/TevmActions.ts (1 hunks)
- packages/memory-client/src/createMemoryClient.js (2 hunks)
Files skipped from review due to trivial changes (2)
- .changeset/large-zoos-knock.md
- packages/memory-client/src/MemoryClient.ts
Additional comments not posted (1)
packages/memory-client/src/createMemoryClient.js (1)
Line range hint
9-93
: Excellent documentation enhancement!The updated JSDoc comments provide a comprehensive overview of the
MemoryClient
's capabilities, including detailed examples and links to further documentation. This should greatly aid users in understanding and utilizing the MemoryClient effectively.Verification successful
Documentation links are valid.
The updated JSDoc comments in
createMemoryClient.js
are comprehensive and enhance the usability of theMemoryClient
. The documentation links provided are valid and accessible.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the validity of documentation links. # Test: Check for HTTP 200 status for each documentation link. curl -o /dev/null --silent --head --write-out '%{http_code}\n' https://tevm.sh/learn/clients/ | grep 200 curl -o /dev/null --silent --head --write-out '%{http_code}\n' https://tevm.sh/reference/tevm/memory-client/type-aliases/tevmactions/ | grep 200 curl -o /dev/null --silent --head --write-out '%{http_code}\n' https://viem.sh/docs/actions/public/introduction | grep 200Length of output: 390
* import { ERC20 } from './MyERC721.sol' | ||
* | ||
* const client = createMemoryClient() | ||
* const token = ERC20.withAddress(`0x${'0721'.repeat(10)}`) | ||
* | ||
* const deploymentResult = await client.tevmDeploy({ | ||
* abi: token.abi, | ||
* bytecode: token.bytecode, | ||
* args: ['TokenName', 18, 'SYMBOL'], | ||
* }) | ||
* | ||
* console.log(deployedResult.createdAddressess) | ||
*/ | ||
tevmDeploy: TevmActionsApi['deploy'] | ||
/** | ||
* Mines a new block with all pending transactions. In `manual` mode you must call this manually before the cannonical head state is updated | ||
* @example | ||
* ```typescript | ||
* import { createMemoryClient } from 'tevm' | ||
* | ||
* const client = createMemoryClient() | ||
* | ||
* await client.tevmMine() | ||
* ``` | ||
*/ | ||
tevmMine: TevmActionsApi['mine'] | ||
/** | ||
* Loads a json serializable state into the evm. This can be useful for persisting and restoring state between processes | ||
* @example | ||
* ```typescript | ||
* import { createMemoryClient } from 'tevm' | ||
* import fs from 'fs' | ||
* | ||
* const client = createMemoryClient() | ||
* | ||
* const state = fs.readFileSync('state.json', 'utf8') | ||
* | ||
* await client.tevmLoadState(state) | ||
* ```` | ||
*/ | ||
tevmLoadState: TevmActionsApi['loadState'] | ||
/** | ||
* Dumps a json serializable state from the evm. This can be useful for persisting and restoring state between processes | ||
* @example | ||
* ```typescript | ||
* import { createMemoryClient } from 'tevm' | ||
* import fs from 'fs' | ||
* const client = createMemoryClient() | ||
* const state = await client.tevmDumpState() | ||
* fs.writeFileSync('state.json', JSON.stringify(state)) | ||
* ``` | ||
*/ | ||
tevmDumpState: TevmActionsApi['dumpState'] | ||
/** | ||
* Sets any property of an account including | ||
* - it's balance | ||
* - It's nonce | ||
* - It's contract deployedBytecode | ||
* - It's contract state | ||
* - more | ||
* @see [SetAccountParams](https://tevm.sh/reference/tevm/actions/type-aliases/setaccountparams/) for options reference] | ||
* @see [SetAccountResult](https://tevm.sh/reference/tevm/actions/type-aliases/setaccountresult/) for return values reference | ||
* @example | ||
* ```typescript | ||
* import { createMemoryClient, numberToHex } from 'tevm' | ||
* import { SimpleContract } from 'tevm/contract' | ||
* | ||
* const client = createMemoryClient() | ||
* | ||
* await client.tevmSetAccount({ | ||
* address: `0x${'0123'.repeat(10)}`, | ||
* balance: 100n, | ||
* nonce: 1n, | ||
* deployedBytecode: SimpleContract.deployedBytecode, | ||
* state: { | ||
* [`0x${'0'.repeat(64)}`]: numberToHex(420n), | ||
* } | ||
* }) | ||
* ``` | ||
* | ||
*/ | ||
tevmSetAccount: TevmActionsApi['setAccount'] | ||
/** | ||
* Gets the account state of an account | ||
* It does not return the storage state by default but can if `returnStorage` is set to `true`. In forked mode the storage is only the storage | ||
* Tevm has cached and may not represent all the onchain storage. | ||
* @see [GetAccountParams](https://tevm.sh/reference/tevm/actions/type-aliases/getaccountparams/) for options reference | ||
* @see [GetAccountResult](https://tevm.sh/reference/tevm/actions/type-aliases/getaccountresult/) for return values reference | ||
* @example | ||
* ```typescript | ||
* import { createMemoryClient } from 'tevm' | ||
* | ||
* const client = createMemoryClient() | ||
* | ||
* const account = await client.tevmGetAccount({ | ||
* address: `0x${'0000'.repeat(10)}`, | ||
* returnStorage: true, | ||
* }) | ||
* ``` | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comprehensive API expansion and excellent documentation!
The API has been significantly expanded to include a variety of new methods that enhance interaction with the EVM. The documentation is detailed, providing clear examples and descriptions of each method's functionality. However, consider adding more detailed examples for the new methods to ensure users can fully understand their usage without ambiguity.
Would you like assistance in creating additional examples or refining the existing documentation?
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @tevm/[email protected] ### Patch Changes - [#1232](#1232) [`a170f0f`](a170f0f) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed issues with error handling and added unit testing ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[]: - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - [#1232](#1232) [`a170f0f`](a170f0f) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed issues with error handling and added unit testing - Updated dependencies \[[`a170f0f`](a170f0f), [`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f), [`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - [#1232](#1232) [`a170f0f`](a170f0f) Thanks [@roninjin10](https://github.com/roninjin10)! - Fix bug with error tags not being set properly - [#1232](#1232) [`a170f0f`](a170f0f) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed issues with error handling and added unit testing ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`6595da4`](6595da4), [`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - [#1232](#1232) [`a170f0f`](a170f0f) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed issues with error handling and added unit testing ## @tevm/[email protected] ### Patch Changes - [#1234](#1234) [`6595da4`](6595da4) Thanks [@roninjin10](https://github.com/roninjin10)! - Add more jsdoc to MemoryClient docs - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f), [`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - [#1232](#1232) [`a170f0f`](a170f0f) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed issues with error handling and added unit testing - Updated dependencies \[[`a170f0f`](a170f0f), [`6595da4`](6595da4), [`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f), [`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[]: - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f), [`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - [#1232](#1232) [`a170f0f`](a170f0f) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed issues with error handling and added unit testing - Updated dependencies \[[`a170f0f`](a170f0f), [`a170f0f`](a170f0f)]: - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`a170f0f`](a170f0f), [`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[]: - @tevm/[email protected] - @tevm/[email protected] ## [email protected] ### Patch Changes - [#1232](#1232) [`a170f0f`](a170f0f) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed issues with error handling and added unit testing - Updated dependencies \[[`a170f0f`](a170f0f), [`6595da4`](6595da4), [`a170f0f`](a170f0f)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Concise description of proposed changes
Testing
Explain the quality checks that have been done on the code changes
Additional Information
Your ENS/address:
Summary by CodeRabbit
New Features
tevmCall
,tevmContract
,tevmDeploy
,tevmDumpState
,tevmGetAccount
,tevmLoadState
,tevmMine
,tevmReady
,tevmSetAccount
.createMemoryClient
to offer detailed examples and explanations for low-level TEVM access.Documentation
tevmScript
in favor oftevmContract
with migration instructions and examples.