Skip to main content
Glama

zetrix_contract_get_testing_guide

Learn how to test Zetrix smart contracts using TEST_INVOKE and TEST_QUERY methods for contract 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

  • src/index.ts:758-765 (registration)
    Tool registration in the tools array, including name, description, and empty input schema (no parameters required).
    { name: "zetrix_contract_get_testing_guide", description: "Get guide on testing Zetrix smart contracts with TEST_INVOKE and TEST_QUERY", inputSchema: { type: "object", properties: {}, }, },
  • Handler in the switch statement that calls zetrixContractDocs.getTestingGuide() and returns the documentation as text content.
    case "zetrix_contract_get_testing_guide": { const docs = zetrixContractDocs.getTestingGuide(); return { content: [ { type: "text", text: docs, }, ], }; }
  • Input schema definition: empty object (no input parameters required).
    inputSchema: { type: "object", properties: {}, }, },
  • The getTestingGuide method in ZetrixContractDocs class that returns the complete testing guide documentation as a markdown string.
    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