/token-plugin

source code and tests for Sovrin Ledger plugins

Primary LanguagePythonApache License 2.0Apache-2.0

img

Table of Contents

  1. Sovrin Token Plugins
    1. Install
    2. Development Environment
      1. Why cant I use my own local machine as my enviroment?
      2. Requirements
      3. Installing docker-sync
      4. Starting Dev Env
      5. Alternative for running tests
    3. How To Contribute

Hex.pm GitHub version

Sovrin Token Plugins

This repo contains the plugins to create the Sovrin payment ledger plugins: Token and Fees

Install

run the following command:

./build_indy_pool

Development Environment

Why is a docker environment included?

We provide a docker environment that comes pre-loaded with all required dependencies and consider this to be the easiest way for any new developer to get setup and start testing their code.

Requirements

Installing docker-sync

gem install docker-sync

Starting Dev Env

PLEASE OPEN TWO TERMINAL WINDOWS

In the first window:

make start

This will run docker-sync-stack start. It will compose the docker container and mount your local directory.

In the second window:

make deps
make setup

This will fix config files and install sovtoken and sovtoken fees

Now we run our test:

make test

when you're all done using sync just use:

make clean 

Alternative for running tests

To use this script, you will need to use make as instructed above. Once you have the docker image running and synchronized, you can use run-test.sh to run individual tests.

We have a shell script to assist with running tests. Here's an example:

./run-test.sh token test_token_req_handler test_token_req_handler_MINT_PUBLIC_validate_missing_output

The first parameter is required. It can be either token or fees. Anything else will return an error.

The remaining parameters are optional.

The second parameter is file name without the .py.

The third parameter is the name of the test.

  1. To run all sovtoken tests call it like this:

    ./run-test.sh token
    
  2. To run all sovtoken tests in a file, call it like this:

    ./run-test.sh token test_token_req_handler
    

How To Contribute

Please follow the guide here.