Neo-fairy-test is a handy tool created by Neo blockchain developer Hecate2 to enhance the testing and debugging experience of Neo N3 smart contracts. It is designed as a plugin for NeoCLI and provides developers with the ability to test transactions and smart contracts against real-world network states. Unlike Neo Express, which offers private networks, neo-fairy-test allows developers to test their transactions and contracts on their own customized version of public networks like MainNet or TestNet.

One of the key features of neo-fairy-test is the ability to perform “fairy operations” such as sending fairy transactions and deploying fairy contracts. These operations are executed and stored in memory on the local node rather than being published in MainNet blocks. This unique feature enables thorough testing against real on-chain environments without the need to redeploy code, incur gas fees, or make unintended changes to the global state. It provides developers with a convenient and efficient way to test their smart contracts.

In addition to facilitating thorough testing, neo-fairy-test also offers robust debugging capabilities. With the DumpNef plugin, developers can set debug information, breakpoints, and invoke contracts via the debug API, which provides a detailed execution trace. The FairyEngine feature allows developers to have fine-grained control over system time and random numbers, making it easier to interact with time-locked smart contracts or debug code that is non-deterministic due to randomness.

The tool also provides a comprehensive guide for debugging Neo N3, utilizing Visual Studio to demonstrate how to debug contract exceptions down to the Neo source code level. The guide covers important Neo core concepts such as remote nodes, transactions, blocks, verification, dBFT consensus, and more, to help developers effectively debug their smart contracts. Additionally, a Python client is available to simplify interactions with a Neo node running the Fairy plugin, providing instructions on how to call fairy contracts, clone snapshots, perform debugging, and more.

To get started with neo-fairy-test, developers can access the tool and its documentation on GitHub at https://github.com/Hecate2/neo-fairy-test/. With its practical tools, comprehensive guide, and Python client, neo-fairy-test offers developers a powerful solution for testing and debugging Neo N3 smart contracts in a real-world on-chain environment. By leveraging the capabilities of neo-fairy-test, developers can streamline their testing processes and improve the efficiency of debugging their smart contracts.

Share.
Leave A Reply

Exit mobile version