Home

Awesome

Contributors Forks Stargazers Issues MIT License

<!-- PROJECT LOGO --> <br /> <p align="center"> <a href="https://github.com/halva-suite/halva"> <img src="https://avatars2.githubusercontent.com/u/67451441?s=400&u=16f743b727e0d20fb8883c9794a87c9d5732fe67&v=4" alt="Logo" width="100" height="100"> </a> <h3 align="center">Halva Suite</h3> <p align="center"> ⚠️ (Work In Progress) <br /> <a href="https://github.com/halva-suite/halva/blob/master/docs/commands.md">Docs</a> | <a href="https://github.com/halva-suite/halva/issues">Report Bug</a> | <a href="https://github.com/halva-suite/halva/issues">Request Feature</a> <br /> <p align="center"><b>🔥 ATTENTION 🔥</br> The module has been tested on Substrate <ins>2.0.0-rc6</ins> version, work on other versions is not guaranteed</b></p> </p> <p align="center"> <img src="https://raw.githubusercontent.com/w3f/General-Grants-Program/aa16ee2840c3ea169352ca3c35e42d8e4d483110/src/badge_black.svg" alt="w3f" width="400"> </p> </p> <!-- ABOUT THE PROJECT -->

About The Project

Inspired by Truffle

Halva is a toolchain for developing Decentralized Applications based on Substrate. It provides a high-level way to configure a development environment, interact with Substrate through external API and writing your test cases. Halva targets testing extrinsics via RPC calls this allows test Substrate (or clients compatible with Substrate RPC) as a black-box.

Built With

Halva uses Polkadot.js

<!-- GETTING STARTED -->

Getting Started

  1. Install halva-cli
npm install -g halva-cli
  1. Configure your network in halva.js
const mnemonic = "bottom drive obey lake curtain smoke basket hold race lonely fit walk";

module.exports = {
  networks: {
    test: {
      mnemonic,
      ws: "ws://127.0.0.1:9944",
    },
  },
  polkadotjs: {
    provider: { },
    types: { }
   },
}

<!-- USAGE EXAMPLES -->

Usage

To run all tests, run:

halva-cli test  -p /path/to/tests/folder -n networkName

If you need help, use

halva-cli --help

To run REPL, simple run:

halva-cli console

Test global scope

You can use global variables provided by halva

describe('Halva test', () => {

  describe('test global', () => {
    it('Get global var', async () => {
        console.log(halva.accounts[0].address); // halva_account global var
    });
  });
});

Variable list:

Assertions

Halva has its own assertion for working with extrinsic and contracts (in the future)

Assertion list:

<!-- ROADMAP -->

Roadmap

See the open issues for a list of proposed features (and known issues).

<!-- CONTRIBUTING -->

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request
<!-- LICENSE -->

License

Distributed under the MIT License. See LICENSE for more information.

<!-- CONTACT -->

Contact

Project Link: https://github.com/halva-suite/halva

<a href="http://wintex.pro/" target="_blank"> <img src="https://github.com/halva-suite/assets/blob/master/wintex.png?raw=true" width="200" /> </a> <!-- MARKDOWN LINKS & IMAGES --> <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->