Testing Framework

Initialize Development Environment

Ask Claude:

Initialize a new Zetrix smart contract development environment

Claude will:

  • Use zetrix_contract_init_dev_environment

  • Create folder structure:

    • contracts/ - Main contract source files

    • contracts/library/ - Reusable modules

    • contracts/specs/ - Test specifications

    • test/ - Integration tests

    • scripts/ - Build, merge, deployment scripts

    • .env - Configuration file


TEST_INVOKE Function

Execute transactions and validate results:

TEST_INVOKE(
    "Test description",
    contractAddress,
    txInitiator,
    {
        method: "methodName",
        params: {
            param1: "value1",
            param2: "value2"
        }
    },
    TEST_RESULT.SUCCESS  // or TEST_RESULT.FAILED
);

Example:


TEST_QUERY Function

Query contract state and validate:

Example:


Last updated