#!/bin/bash set -e runtime="casper" bags=200 while getopts r:b:t:e: flag do case "${flag}" in r) runtime=${OPTARG};; b) bags=${OPTARG};; t) total=${OPTARG};; e) existential=${OPTARG};; esac done if [[ -z "$total" ]]; then echo "### ERROR: -t flag (total supply) should be set." exit fi if [[ -z "$existential" ]]; then echo "### ERROR: -e flag (existential deposit) should be set." exit fi echo -e "### ${runtime} runtime will be used with ${bags} bags" echo -e "### while total issuance is ${total} and existential deposit ${existential}" read -p "### Do you want to regenerate 'bags_thresholds.rs' file? (Y/n)? " answer if [ $answer != ${answer#[Yy]} ]; then cargo run --package ghost-voter-bags -- \ --n-bags=${bags} \ --runtime=${runtime} \ --output=$PWD/runtime/${runtime}/src/bag_thresholds.rs \ --total-issuance=${total} \ --minimum-balance=${existential} echo "### Bags generated succefully" else exit fi