Skip to main content
Glama

zetrix_contract_get_testing_guide

Learn to test Zetrix smart contracts using TEST_INVOKE and TEST_QUERY methods for development verification.

Instructions

Get guide on testing Zetrix smart contracts with TEST_INVOKE and TEST_QUERY

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler case in the main tool dispatcher that calls ZetrixContractDocs.getTestingGuide() to retrieve and return the testing guide documentation.
    case "zetrix_contract_get_testing_guide": { const docs = zetrixContractDocs.getTestingGuide(); return { content: [ { type: "text", text: docs, }, ], }; }
  • Tool schema definition and registration in the tools array, specifying name, description, and empty input schema.
    { name: "zetrix_contract_get_testing_guide", description: "Get guide on testing Zetrix smart contracts with TEST_INVOKE and TEST_QUERY", inputSchema: { type: "object", properties: {}, }, },
  • Core helper method that returns the detailed markdown-formatted testing guide for Zetrix smart contracts, including TEST_INVOKE and TEST_QUERY usage examples.
    getTestingGuide(): string { return `# Zetrix Smart Contract Testing Guide ## TEST_INVOKE Function Execute transactions and validate results: \`\`\`javascript TEST_INVOKE( "Test description", contractAddress, txInitiator, { method: "methodName", params: { param1: "value1", param2: "value2" } }, TEST_RESULT.SUCCESS // or TEST_RESULT.FAILED ); \`\`\` ### Example \`\`\`javascript TEST_INVOKE( "Transfer tokens from Alice to Bob", contractAddress, aliceAddress, { method: "transfer", params: { to: bobAddress, amount: "1000" } }, TEST_RESULT.SUCCESS ); \`\`\` ## TEST_QUERY Function Query contract state and validate: \`\`\`javascript TEST_QUERY( "Test description", contractAddress, { method: "methodName", params: { param1: "value1" } }, TEST_CONDITION.EQUALS, // Comparison operator expectedValue, ["result", "field", "path"] // JSON path to value ); \`\`\` ### Example \`\`\`javascript TEST_QUERY( "Check Bob's balance is 1000", contractAddress, { method: "balanceOf", params: { address: bobAddress } }, TEST_CONDITION.EQUALS, "1000", ["result", "balance"] ); \`\`\` ## Test Conditions - **TEST_CONDITION.EQUALS** - Exact value match - **TEST_CONDITION.GREATER_THAN** - Numeric greater than - **TEST_CONDITION.LESSER_THAN** - Numeric less than - **TEST_CONDITION.CONTAINS** - String/array contains ## Test Organization ### Integration Tests (On-Chain) Located in \`tests/integration/\` \`\`\`bash npm test tests/integration/ztp20/test-ztp20Core.js \`\`\` ### Unit Tests (Local) Located in \`tests/unit/\` \`\`\`bash npm run test-coverage tests/unit/ztp20/test-ztp20.js \`\`\` See SMART_CONTRACT_DEVELOPMENT.md for complete testing guide.`; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Zetrix-Chain/zetrix-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server