Coder Social home page Coder Social logo

shooklyngs / godwoken-tests Goto Github PK

View Code? Open in Web Editor NEW

This project forked from godwokenrises/godwoken-tests

0.0 0.0 0.0 3.74 MB

Integration tests for Godwoken

License: MIT License

Shell 0.50% JavaScript 77.97% Rust 5.77% TypeScript 9.85% Solidity 5.90%

godwoken-tests's Introduction

How to test your Solidity contracts on Godwoken v1

Test on testnet

You can follow the command-lines below to install Godwoken-Tests in your local environment, and run contract tests on testnet_v1:

  1. git clone https://github.com/nervosnetwork/godwoken-tests - Clone Godwoken-Tests
  2. cd godwoken-tests/contracts - Go to contracts folder
  3. npm install - Install dependencies
  4. npm run test:gw_testnet_v1 - Run tests on testnet_v1

Deploy and test on devnet

If you wish to run tests on devnet instead of testnet, please read the current section.

First, you need to install Godwoken-Kicker, and then deploy a local devnet_v1 running in the localhost network:

  1. git clonehttps://github.com/godwokenrises/godwoken-kicker - Clone Godwoken-Kicker
  2. cd godwoken-kicker - Go to kicker tool’s folder
  3. ./kicker start - Deploy and start a devnet_v1 in localhost network

The deployment will take some time to complete, and for more detailed about how to start devnet in your localhost network, please read this: Deploy Local Network of Godwoken.

After the devnet started, you should deposit some testing capacity of testing accounts from layer 1 (CKB network) to layer 2 (Godwoken network):

./kicker deposit 0x966b30e576a4d6731996748b48dd67c94ef29067 10000
./kicker deposit 0x4fef21f1d42e0d23d72100aefe84d555781c31bb 10000

NOTE: After the deposit commands have been completed, please wait 15 seconds before moving forward. Godwoken needs some time to consume and confirm deposit requests.

After deposited, you can follow command-lines below to install Godwoken-Tests in your local environment, and run contract tests on devnet_v1:

  1. git clone https://github.com/nervosnetwork/godwoken-tests - Clone Godwoken-Tests
  2. cd godwoken-tests/contracts - Go to contracts folder
  3. npm install - Install dependencies
  4. npm run test - Run tests on devnet_v1

Use your preferred accounts in the tests

Testing accounts are defined in contracts/hardhat.config.js.

If you prefer using your own accounts for testing, you can replace them in the source code, or run test commands with environment variables, for example:

PRIVATE_KEY=<YOUR_KEY> npm run test

godwoken-tests's People

Contributors

jjyr avatar flouse avatar xxuejie avatar bitrocks avatar zeroqn avatar ethanyuan avatar thewawar avatar shooklyngs avatar retricsu avatar classicalliu avatar keroro520 avatar magicalne avatar dawn-githup avatar gpblockchain avatar e00dan avatar floustar avatar i-am-sam-codes avatar dependabot[bot] avatar m-bo-one avatar sunchengzhu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.