-
-
Notifications
You must be signed in to change notification settings - Fork 2
Implement complete onchain testing toolkit for blockchain applications /.github/copilot-instructions.md /.github/instructions/**/*.instructions.md **/AGENTS.md /CLAUDE.md /GEMINI.md #1
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
Conversation
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.
Copilot wasn't able to review any files in this pull request.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: joe10832 <103850533+joe10832@users.noreply.github.com>
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.
Pull Request Overview
Copilot reviewed 25 out of 28 changed files in this pull request and generated 5 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| "example/frontend" | ||
| ], | ||
| "exports": { | ||
| ".": "./dist/src/index.js", |
Copilot
AI
Sep 23, 2025
•
edited by joe10832
Loading
edited by joe10832
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.
@Copilot-Setup-Steps The main export path is incorrect. Since the main field points to dist/index.js, the exports field should point to ./dist/index.js to maintain consistency.
| ".": "./dist/src/index.js", | |
| ".": "./dist/index.js", |
| "devDependencies": { | ||
| "@biomejs/biome": "1.5.3", | ||
| "@changesets/cli": "^2.29.5", | ||
| "@coinbase/onchaintestkit": "^1.2.0", |
Copilot
AI
Sep 23, 2025
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.
The package declares itself as a dependency in devDependencies. This creates a circular dependency and should be removed.
| "@coinbase/onchaintestkit": "^1.2.0", |
| const existingSetup = this.config.walletSetup | ||
| this.config.walletSetup = async (wallet: WalletType, context) => { | ||
| if (existingSetup) { | ||
| await existingSetup(wallet as T, context) | ||
| } | ||
| await newSetup(wallet as T, context) |
Copilot
AI
Sep 23, 2025
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.
The type casting wallet as T indicates a design issue. Consider restructuring the method to work with proper generic constraints instead of relying on type assertions.
| const existingSetup = this.config.walletSetup | |
| this.config.walletSetup = async (wallet: WalletType, context) => { | |
| if (existingSetup) { | |
| await existingSetup(wallet as T, context) | |
| } | |
| await newSetup(wallet as T, context) | |
| const existingSetup = this.config.walletSetup as ((wallet: T, context: WalletSetupContext) => Promise<void>) | undefined | |
| this.config.walletSetup = async (wallet: T, context) => { | |
| if (existingSetup) { | |
| await existingSetup(wallet, context) | |
| } | |
| await newSetup(wallet, context) |
| export type BaseWalletConfig = { | ||
| type: "metamask" | "coinbase" | "phantom" | ||
| password?: string | ||
| walletSetup?: ( | ||
| wallet: MetaMask | CoinbaseWallet | PhantomWallet, | ||
| context: WalletSetupContext, | ||
| ) => Promise<void> | ||
| } |
Copilot
AI
Sep 23, 2025
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.
This type definition duplicates the wallet configuration type defined in src/wallets/types.ts. Consider consolidating these types to avoid duplication and potential inconsistencies.
| context: async ({ context, node }, use) => { | ||
| // Get the dynamic port from the node fixture | ||
| const localNodePort = | ||
| node && "port" in node ? (node as { port: number }).port : null |
Copilot
AI
Sep 23, 2025
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.
The type checking with 'port' in node followed by type assertion suggests the node type is not properly defined. Consider creating a proper interface for the node fixture.
joe10832
left a comment
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.
joe10832
left a comment
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.
joe10832
left a comment
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.
joe10832
left a comment
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.
[WIP] Update various existing features for improvement
This PR transforms the repository from a simple C++ utility into a comprehensive TypeScript/JavaScript testing toolkit for blockchain applications, based on the original joe10832/onchaintestkit repository.
What was implemented
Core Testing Framework
Configuration API
Wallet Action System
Development Infrastructure
prepare-metamask,prepare-coinbase,prepare-phantom)Local Node Management
Architecture
The implementation follows the original repository's structure with:
Testing
Created and verified a working example that demonstrates:
All code passes TypeScript compilation and Biome linting checks, ensuring production-ready quality.
Next Steps
The current implementation provides functional stub implementations that serve as a foundation for:
This establishes a complete, extensible framework for end-to-end blockchain application testing.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.